php - Imagick convert CMYK JPG to PNG and transparency -
i have cmyk jpg file need cut parts , save cmyk png file. problem open jpg file , save png file colors shifted massively. i've been trying fix day , have exhausted available resources on , google.
here's code:
$imagestick = new imagick("original.jpg"); // cmyk jpg  $largestick = new imagick(); // create bigger png file transparent background $largestick->newimage($smallstick->getimagewidth(), $smallstick->getimageheight() * 3, new imagickpixel('transparent'), 'png');  $largestick->compositeimage($smallstick, imagick::composite_default, 0, 0);  $largestick->writeimage("resampled.png");   and here images:
 - original - download file
 - resampled
any ideas why happening?
i've tried copying possible profiles , image properties original jpg file:
foreach ($smallstick->getimageprofiles() $name => $profile)     !empty($profile) && $largestick->setimageprofile($name, $profile);  foreach ($smallstick->getimageproperties() $name => $property)     !empty($profile) && $largestick->setimageproperty($name, $property);  $largestick->setcolorspace($smallstick->getcolorspace());   manually setting icc profile no luck @ all:
$icc_cmyk = file_get_contents('uswebuncoated.icc'); $largestick->profileimage('icc', $icc_cmyk);   any thoughts on highly appreciated!
thanks!
 
 
Comments
Post a Comment