How properly convert created Image with GD to sRGB
Posted: 2016-12-08T08:21:03-07:00
I have to work with an image with PHP GD. The problem is when I copy the original picture, the colors are not the same.
My original Picture :
http://regex.info/exif.cgi?imgurl=https ... euil_3.jpg
People told me to convert my jpg into sRGB profil instead AdobeRPG.
So I did it in PHP :
The colors are the same, but the contraste is now different :
http://regex.info/exif.cgi?dummy=on&im ... plat-7.jpg
I know that not the same size and the same quality, is normal.
I went to Facebook, to see, how he does in his own upload system, I tried with my picture and it's work very well, but i have no idea how they have done.
How can I properly convert all JPEG file to sRGB ?
Thank you.
My original Picture :
http://regex.info/exif.cgi?imgurl=https ... euil_3.jpg
People told me to convert my jpg into sRGB profil instead AdobeRPG.
So I did it in PHP :
Code: Select all
$image = new Imagick($chemin_image);
// On enleve tout les profils qu'il y avait à la base
$image->profileImage('*' , false);
// Essayer de mettre en SRGB si ce n'est pas le cas
$icc_srgb = file_get_contents('profil_icc/sRGB_IEC61966-2-1_black_scaled.icc');
$image->profileImage('icc' , $icc_srgb);
$image->transformImageColorspace(13);
$image->writeImage($chemin_image);
http://regex.info/exif.cgi?dummy=on&im ... plat-7.jpg
I know that not the same size and the same quality, is normal.
I went to Facebook, to see, how he does in his own upload system, I tried with my picture and it's work very well, but i have no idea how they have done.
How can I properly convert all JPEG file to sRGB ?
Thank you.