steganoImage php question

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

steganoImage php question

Post by nunjimmimya »

hi

it's been many months since i use your imagick and let say it very usable to me (although i'm not very expert in scripting and programming)

i would like to ask about php steganoImage usage as there's no proper documentation in php site
would you explain a little on how to properly stegano an image and reverse it back

another question is:
let say by using your exmple

Code: Select all

composite message.gif rose: -stegano +15+2  rose_message.png
if i have my own host image to stegano it, how do i do that

thank you in advance :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

I have not use this feature, but you can see examples at http://www.imagemagick.org/Usage/transform/#stegano
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

Re: steganoImage php question

Post by nunjimmimya »

thanks for the fast reply

Code: Select all

composite message.gif rose: -stegano +15+2  rose_message.png
as far as i know rose is embedded in the imagemagick system, so how can i call my own image instead of calling 'rose', 'logo' and other embedded image
i tried replacing rose with 'myownimage.png': but the command line seems 'hung'

below are my command line argument

Code: Select all

composite Desktop/message.gif Sites/stegano/image.png: -stegano +15+2  Desktop/stegano_message.png
also fails when trying to compare

Code: Select all

compare -metric PAE /Users/nunjimmimya/Sites/stegano/image.png: /Users/nunjimmimya/Sites/stegano/stegano.png /Users/nunjimmimya/Desktop/diff.png
did i miss anything anywhere?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

composite Desktop/message.gif Sites/stegano/image.png: -stegano +15+2 Desktop/stegano_message.png
Take out the : after the image.

composite Desktop/message.gif Sites/stegano/image.png -stegano +15+2 Desktop/stegano_message.png

That should work if your image is large enough to hold message.gif allowing for the offsets. Did it work with rose?

Do you have read permissions from Sites/stegano and for the image.png? Is that the correct path from the working directory?

What version of IM are you using and on what platform?

This test worked just fine for me and ran almost instanteneously.

message.gif is on my desktop and monet3.jpg is in the working directory from which I ran the command.

composite /Users/fred/desktop/message.gif monet3.jpg -stegano +15+2 monet3_stegano.png

I am on IM 6.8.0.8 Q16 Mac OSX Snow Leopard
Last edited by fmw42 on 2012-12-12T17:20:36-07:00, edited 2 times in total.
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

Re: steganoImage php question

Post by nunjimmimya »

fred

below is my version installed

Code: Select all

Version: ImageMagick 6.8.0-2 2012-10-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:  OpenCL 
i got the 'hang' problem when using command line and not in php
wonder what the error

the test just fine with the rose but not the file that i want

attach is identify result for my host image

Code: Select all

identify ../Sites/stegano/image.png 
../Sites/stegano/image.png PNG 640x480 640x480+0+0 8-bit sRGB 348KB 0.000u 0:00.000
and this one is the message

Code: Select all

../Sites/stegano/message.gif GIF 50x40 50x40+0+0 8-bit sRGB 256c 1.33KB 0.000u 0:00.000
thank you for taking your time to look at my issue

*update
problem has been found

your 'rose' has ':' and your previous example didn't have ':'
can you explain what with the ':' thing?

i'm planning to run command line as last option if i can't use php imageStegano command to revert the hidden message
where can i get the documentation for php imageStegano command?

sorry for asking too much for you. your effort in contributing IM is already awesome ;)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

Sorry I missed the colon : in your command. That is just to identify IM built-in images. See http://www.imagemagick.org/script/forma ... tin-images All normal images should not include the ending colon.

i'm planning to run command line as last option if i can't use php imageStegano command to revert the hidden message
where can i get the documentation for php imageStegano command?
I have no idea what that is. Unless it is in Imagick, it is not related to Imagemagick. You can run the command line for IM stegano in a PHP exec() command.

If you mean this http://php.net/manual/en/imagick.steganoimage.php, then it is an Imagick PHP call. Imagick is not supported by Imagemagick. But there is a forum for it at viewforum.php?f=18
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

Re: steganoImage php question

Post by nunjimmimya »

thanks a lot for guiding me to the end of the road
next road is a imagick in php

thank a lot
you really save my early morning (in malaysia ;) )
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

nunjimmimya wrote:thanks a lot for guiding me to the end of the road
next road is a imagick in php

thank a lot
you really save my early morning (in malaysia ;) )
Why do you want to use Imagick. It is no longer supported and does not have all the IM functionality. You can easily follow the examples at http://www.imagemagick.org/Usage/transform/#stegano, and just put them into PHP exec().
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

Re: steganoImage php question

Post by nunjimmimya »

fmw42 wrote: Why do you want to use Imagick. It is no longer supported and does not have all the IM functionality. You can easily follow the examples at http://www.imagemagick.org/Usage/transform/#stegano, and just put them into PHP exec().
i'm using this just as requirement for my class project
actually what my lecturer wants me to find is a digital watermarking component (no the algorithm)
as it difficult to find, then i'm proposing him to use stegano component which IM does have it

while i'm searching for it, i found it has wrapper class in PHP so i tried to implement by using it without not thinking there would be such as difficult as this :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

actually what my lecturer wants me to find is a digital watermarking component (no the algorithm)
see http://www.imagemagick.org/Usage/compose/#watermark


Watermarking and stegano are quite different. In the watermark, you see the second image. In the stagano, it is hidden.
nunjimmimya
Posts: 10
Joined: 2012-12-12T13:07:48-07:00
Authentication code: 6789

Re: steganoImage php question

Post by nunjimmimya »

the problem with IM watermark is they're visible

the requirement is that you need to create a invincible watermark like digimarc did
that why i change from watermark to stegano

yeah, i know it quite troublesome for your to understand my situation and that is the issue :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: steganoImage php question

Post by fmw42 »

OK, I understand, but probably cannot help with Imagick. All I can do is suggest you just use PHP exec() with the command line commands, which are easier to understand from http://www.imagemagick.org/Usage/transform/#stegano

With regard to Imagick steganoImage, it should work with similar information. I assume you just tell it what watermark image you want to use and the offsets.

To recover it, I would assume you just create an empty image with the size values as per the link above and then specify the input stegano image with the preface of stegano:stegano_image.png.

But I have not tested this and am not really an expert in Imagick.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: steganoImage php question

Post by anthony »

fmw42 wrote:Sorry I missed the colon : in your command. That is just to identify IM built-in images. See http://www.imagemagick.org/script/forma ... tin-images All normal images should not include the ending colon.
Actually the ':' means a prefixed 'coder', or image delegate. The name us usally the format of the image but can mean other things. That is, it is a 'loaded' module that either reads in, creates, or writes out a image. It may, (or in this case) may not, need a filename, color, or other argument, to work properly.

"rose:" is a special coder that generates a rose image from built-in data. That is all it does.

Other coders may generate image using a mathematicaly such as "gradient:", using specified colors, and a perviously given -size setting. Others like "mpc:" lets you store images in a named in-mmeory data store, and read them out again.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply