1#!/usr/bin/perl 2 3use Image::Magick; 4 5# 6# Hide an image within an image 7# 8$watermark=Image::Magick->new; 9$watermark->ReadImage('smile.gif'); 10($width, $height)=$watermark->Get('width','height'); 11# 12# Hide image in image. 13# 14$image=Image::Magick->new; 15$image->ReadImage('model.gif'); 16$image->SteganoImage(image=>$watermark,offset=>91); 17$image->Write('model.png'); 18$image->Write('win:'); 19# 20# Extract image from image. 21# 22$size="$width" . "x" . "$height" . "+91"; 23$stegano=Image::Magick->new(size=>$size); 24$stegano->ReadImage('stegano:model.png'); 25$stegano->Write('stegano.gif'); 26$stegano->Write('win:'); 27