Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert image from RGB to CMYK with Imagick
    primarykey
    data
    text
    <p>I'm trying to convert RGB images to CMYK, because they need to be printed. I'm using this code:</p> <pre><code>&lt;?php $filePath = 'rgb.jpg'; // First save image as png $image = new Imagick($filePath); $image-&gt;setImageCompression(Imagick::COMPRESSION_UNDEFINED); $image-&gt;setImageCompressionQuality(0); $image-&gt;setImageFormat("png"); $filePath = 'rgb.png'; $image-&gt;writeImage($filePath); $image-&gt;clear(); $image-&gt;destroy(); $image = null; // Convert colors $image = new Imagick($filePath); $image-&gt;stripImage(); $image-&gt;setImageColorspace(Imagick::COLORSPACE_CMYK); $image-&gt;setImageCompression(Imagick::COMPRESSION_UNDEFINED); $image-&gt;setImageCompressionQuality(0); $image-&gt;setImageFormat("png"); $filePath = 'cmyk.png'; $image-&gt;writeImage($filePath); $image-&gt;clear(); $image-&gt;destroy(); $image = null; $fileUrl = 'http://www.product-designer.nl/rgb2cmyk/cmyk.png'; ?&gt; CMYK Image:&lt;br/&gt; &lt;img src="&lt;?php echo $fileUrl; ?&gt;" width="400" /&gt;&lt;br /&gt;&lt;br /&gt; &lt;?php $fileUrl = 'http://www.product-designer.nl/rgb2cmyk/rgb.png'; ?&gt; RGB Image:&lt;br/&gt; &lt;img src="&lt;?php echo $fileUrl ?&gt;" width="400" /&gt; </code></pre> <p>You can see the result on <a href="http://product-designer.nl/rgb2cmyk" rel="nofollow">http://product-designer.nl/rgb2cmyk</a> I don't know how, but somehow the colors on the image become inverted. I need to convert the image but the colors need to be as close to the RGB colors as possible.</p> <p>Does anyone know how to do this?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload