i can not convert rgb picture to cmyk with php ?
Posted: 2013-11-22T16:47:09-07:00
Hello.
I have a jpeg rgb file that i have to convert to cmyk.
The original file is here :
http://images.superspeed.fr/1.jpg
i use this code i found in a forum :
and i get thar very ugly pic :
http://images.superspeed.fr
Do you know why ?
I have a jpeg rgb file that i have to convert to cmyk.
The original file is here :
http://images.superspeed.fr/1.jpg
i use this code i found in a forum :
Code: Select all
<?php
$filePath = "1.jpg";
$i = new Imagick($filePath);
$cs = $i->getImageColorspace();
if ($cs == Imagick::COLORSPACE_SRGB ||
$cs == Imagick::COLORSPACE_RGB){
print "Image is RGB<br/>\n";
$i->setImageColorspace(Imagick::COLORSPACE_CMYK);
$i->setImageFormat('jpeg');
$filePath = "1cmjn.jpg";
$i->writeImage($filePath);
} else {
print "Image is not RGB<br/>\n";
}
if ($cs == Imagick::COLORSPACE_CMYK) {
print "Image is CMYK<br/>\n";
}
$i->clear();
$i->destroy();
$i = null;
http://images.superspeed.fr
Do you know why ?