Problems converting to sRGB profile

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
qmarcos
Posts: 1
Joined: 2011-10-10T14:28:03-07:00
Authentication code: 8675308

Problems converting to sRGB profile

Post 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.
Post Reply