I have used the following code to create jpeg image using existing images. These images have used embedded color profile, Adobe1998 color profile.
header("Content-type: image/jpeg");
$src = imagecreatefromjpeg($upfile);
$dst = imagecreatetruecolor($tn_width, $tn_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height);
imagejpeg($dst,NULL,100);
imagedestroy($src);
imagedestroy($dst);
The problem here is that when the image is displayed embedded color profile is not seen. Can anyone help me? What may be the problem ?
Thanks in advance
imagecratefromjpeg() makes use us the GD2-Lib, which seems not to support color profiles. You should consider using imagemagick to resize your image like this:
convert mypicture.jpg -resize 50% resized.jpg
The color profile should be still in the image.
Color profiles are pieces of information embeded in the image specific to the display media that was used originally (basically matches the color-profile for you monitor), so when opening the same image on another media, the colors will be adjusted after opening it to match more closely what you saw initially on your monitor.
Try using convert as schneck sugested, and if that dosen't work, you may also try GIMP from the command line. I've never personally used it from the cmd line, but it does support color profiles, and i know it has some options for batch transformations.