Page 1 of 1

Problems converting to sRGB profile

Posted: 2011-10-10T14:46:41-07:00
by qmarcos
Hi,

I'm a newbie using ImageMagick (I usually worked with GD) and I need to convert all the images uploaded by users into our system to a sRGB color profile, because the imagenes could be printed on paper in the future. We have done some test, but we found big differences between applying sRGB profiles in photoshop, against imageMagick. With ImageMagick I get whitish images...

Here is my code:

Code: Select all

$imgMagick = $imgMagick = new Imagick('myImage.jpg');
$profile = 'http://www.color.org/sRGB_v4_ICC_preference_displayclass.icc';

// Other tested profiles are:
// http://www.color.org/sRGB_IEC61966-2-1_black_scaled.icc
// http://www.color.org/sRGB_IEC61966-2-1_no_black_scaling.icc
// http://www.color.org/sRGB_v4_ICC_preference.icc

if (($srgb = file_get_contents($profile)) !== false)
{
	$imgMagick->profileImage('icc', $srgb);
	$imgMagick->setImageColorSpace(Imagick::COLORSPACE_SRGB);
}
$imgMagick->writeImage();
Thanks in advance for your help,
Marcos.