and the small image still can be detected by Imagemagick.
thansks fanaticjasper!
How to make an small image invisible inside a large image
Re: How to make an small image invisible inside a large image
You want -stegano, there is some info on this page http://www.imagemagick.org/script/comma ... p?#stegano
BUT I think it is hard to view the image - need an X11 server ? Also if you are using it as an invisible watermark to prove the image is yours and the person who uses your image cuts anything off the top left corner you will probably not be able to find the image again anyway.
BUT I think it is hard to view the image - need an X11 server ? Also if you are using it as an invisible watermark to prove the image is yours and the person who uses your image cuts anything off the top left corner you will probably not be able to find the image again anyway.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to make an small image invisible inside a large image
The -stegano operatation is really more of a 'fun' operator. For example it could be use by a spy to hide info in the 'chaos' of a random image.
As a means of image copyright protection, it is useless. The smallest change to an image and the hidden data is lost.
This is why I haven't really added any example of its used in IM examples, as it is pretty useless.
The following is an example...
First the message (and get its size)Size is 36x43 whcih we will need...
Next the put it into some image...
you can check the difference with compare
which shows the image was changed all over, but only a peak difference of 1 color unit (Whcih means JPEG will destroy the data.
now lets recover the hidden image...
Not that we needed the original images size and its offset for this to work!
if you get the size, or the offset wrong, or the image was modified, or even saved a JPEG, the message will be lost!
As a means of image copyright protection, it is useless. The smallest change to an image and the hidden data is lost.
This is why I haven't really added any example of its used in IM examples, as it is pretty useless.
The following is an example...
First the message (and get its size)
Code: Select all
convert -gravity center label:"Watch\nthe\nBirdy" message.gif
identify message.gif
Next the put it into some image...
Code: Select all
convert rose: rose_original.png
composite message.gif rose: -stegano +15+5 rose_message.png
Code: Select all
compare -metric PAE rose_original.png rose_message.png rose_difference.png
now lets recover the hidden image...
Code: Select all
convert -size 36x43+15+5 stegano:rose_message.png message_recovered.gif
if you get the size, or the offset wrong, or the image was modified, or even saved a JPEG, the message will be lost!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to make an small image invisible inside a large image
Hi, may I have the source code for stegano?(any language:VB, C++, C#,C)
what does "1 color unit difference" mean? thanks you!
what does "1 color unit difference" mean? thanks you!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to make an small image invisible inside a large image
A image is stores with with Red Green and Blue values saved as an 8 bot or 16 bit integer. A 1 color uint change means that value only changed by 1 (basically invisible)
Source code is in IM source . look for SteganoImage() in "magick/fx.h"
Source code is in IM source . look for SteganoImage() in "magick/fx.h"
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to make an small image invisible inside a large image
Code: Select all
for (i=QuantumDepth-1; (i >= 0) && (j < QuantumDepth); i--)
{
for (y=0; (y < (long) watermark->rows) && (j < QuantumDepth); y++)
{
for (x=0; (x < (long) watermark->columns) && (j < QuantumDepth); x++)
{
pixel=AcquireOnePixel(watermark,x,y,exception);
q=GetImagePixels(stegano_image,k % (long) stegano_image->columns,
k/(long) stegano_image->columns,1,1);
if (q == (PixelPacket *) NULL)
break;
switch (c)
{
case 0:
{
SetBit(q->red,j,GetBit(PixelIntensityToQuantum(&pixel),i));
break;
}
case 1:
{
SetBit(q->green,j,GetBit(PixelIntensityToQuantum(&pixel),i));
break;
}
case 2:
{
SetBit(q->blue,j,GetBit(PixelIntensityToQuantum(&pixel),i));
break;
}
}
if (SyncImagePixels(stegano_image) == MagickFalse)
break;
c++;
if (c == 3)
c=0;
k++;
if (k == (long) (stegano_image->columns*stegano_image->columns))
k=0;
if (k == image->offset)
j++;
}
}
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to make an small image invisible inside a large image
Stegno is NOT a watermarking function.. If you make the changes visible as I did in IM Examples you will see garbage.
http://www.imagemagick.org/Usage/transform/#stegno
It hides images in images, it does not watermarks images.
For Watermarking See...
http://www.imagemagick.org/Usage/annotating/#watermark
http://www.imagemagick.org/Usage/transform/#stegno
It hides images in images, it does not watermarks images.
For Watermarking See...
http://www.imagemagick.org/Usage/annotating/#watermark
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to make an small image invisible inside a large image
I want to hide an image in image.
The PNG image format supports 16 bit grayscale natively, although browsers and many imaging programs tend to ignore the low order 8 bits of each pixel.
if I have an image R(8bits) G(8bits) B(8bits) , does"Hide watermark in low-order bits of image " means expand to R(16bits) G(16bits) B(16bits) ....
The PNG image format supports 16 bit grayscale natively, although browsers and many imaging programs tend to ignore the low order 8 bits of each pixel.
if I have an image R(8bits) G(8bits) B(8bits) , does"Hide watermark in low-order bits of image " means expand to R(16bits) G(16bits) B(16bits) ....