Open rahgurung opened 4 years ago
Looking the example at: https://github.com/ImageMagick/ImageMagick/blob/306762972e7c7dd2158bf00d39ed2ebd87c49e65/PerlMagick/demo/steganography.pl
It seems the following code should work, but doesn't.
# Hide an image within an image
$watermark = new Imagick();
$watermark->readImage('smile.gif');
$width = $watermark->getImageWidth();
$height = $watermark->getImageHeight();
# Hide image in image.
$image = new Imagick();
$image->readImage('model.gif');
$image->steganoImage($watermark, 91);
$image->writeimage('output.png');
# Extract image from image.
$stegano = new Imagick();
$stegano->setSizeOffset($width, $height, 91);
$stegano->readImage('stegano:output.png');
$stegano->writeImage('recovered.gif');
echo "fin.\n";
It runs, but the recovered image is random garbage.
Thanks....that works. I wonder why the example I gave doesn't...
steganoImage() hides a water mark in a image. I need a function to get the water mark back, maybe it can accept offset as parameter.