in reply to Image::Magick stegano question

i have no way now of verifying that it is in there.
You can only retrieve the hidden image if you know that it's there, and know its size and offset (that's the point of steganography). There's no way to "check" in general whether something is hidden if you don't know precisely how to retreive it.
-stegano
hide watermark within an image. Use an offset to start the image hiding some number of pixels from the beginning of the image. Note this offset and the image size. You will need this information to recover the steganographic image (e.g. display -size 320x256+35 stegano:image.png).

http://docent.hogent.be/~pvt340/multimed/webpages/combine.html

This probably translates into PerlMagick like this:

my $img = Image::Magick->new; $img->Set(size=>'100x100+5'); $img->ReadImage('stegano:result.gif');
If this produces an image that "makes sense", then you know the watermark was there. Otherwise, you'll probably get random pixels.

blokhead

Replies are listed 'Best First'.
Re^2: Image::Magick stegano question
by bear0053 (Hermit) on Jun 24, 2004 at 21:17 UTC
    yes that is exactly what i am looking for. I insert the hidden watermark myself as shown in the code in my original post. The problem is I do not know the syntax needed to read it back out and check. I tried to use your code suggestion but that only prints me out the original base image which doesn't verify anything. I can't seem to uncover the syntac needed to extract the stegano inserted.
    my $background=Image::Magick->new(magick=>"gif"); $background->BlobToImage($bin_data); $background->Set(size=>"100x100+1"); #size and offset of watermark + inserted $background->Read('stegano:result.gif'); $background->Write("gif-"); $bin_data = $background->ImageToBlob(); print "content-type: image/gif\n\n"; print $bin_data;
    this only prints the full sized original image. not the watermark and it doesn't even display an image of the correct size. It shuold be 100x100 but instead is the regular full size of 640x460? thanks
      $background->Read('stegano:result.gif');
      tries to read from result.gif, but you're also trying to read from a blob at the same time.

      As far as I can tell, the image needs to read from a file for this to work. I tried setting the magick to "stegano" and the correct size and offset before reading from a blob and didn't get any luck. Saving to a file and doing Read("stegano:filename") worked fine for me with the code from my first reply.

      Maybe someone with more PerlMagick experience can help out.. I only found one example of writing and reading a watermark using PerlMagick, but not from a blob.

      blokhead

        thanks. yeah that is my problem i can't find any examples and I am haveing a hard time figuring out the docs for that part. UPDATE: downvoted because why?