One challenge from yashira, has this ORIGINAL image.
ORIGINAL PNGthis image, has a hide message, i solved this, with a little help. And to solve this what yo have to do is to COMPARE the same image, in format jpg, so i open the same image, and save as JPG,
SAME IMAGE saved as in JPG FORMATThen make a script that compares the differences, and for each different pixel, the script set a black pixel. The script is the following:
Code: Select all
<?php
$original=imagecreatefromjpeg('original.jpg');
$modified=imagecreatefrompng('modified.png');
$size=getimagesize('original.jpg');
$output=imagecreate($size[0],$size[1]);
imagecolorallocate($output,255,255,255);
$cblack=imagecolorexact($output,0,0,0);
for($a=0;$a<$size[0];$a++){
for($b=0;$b<$size[1];$b++){
$colororiginal=imagecolorat($original,$a,$b);
$colormodified=imagecolorat($modified,$a,$b);
if ($colororiginal!=$colormodified) imagesetpixel($output,$a,$b,$cblack);
}
}
imagepng($output,'solved.png');
?>
Ok everything is allright, but mi doubt, is:
How can i hide some message, like this???? Is obviosly that it can be possible copying the image, and in the second image set differents pixels, with minimun diference (original= 255,255,255 second image= 255,255,254). This way is ok, but in the challenge image, there's just one image, and you have to save it as JPG. How is possible to hide a message, and just saving the same picture in diferent format, get the message???
That is my question. I ask here, cuz i investigate and the author challenge, said that he made the technique with GD. but he doesn't want to tell how.
Hoping my english will be understandable. And hoping you can help me.
Thank you.