Link to home
Start Free TrialLog in
Avatar of spoggles
spoggles

asked on

php convert rgb to cmyk

Hello Experts!

I am using Imagick to convert a QR generated from Google Charts to the Color space CMYK. I want to convert the QR code to CMYK for printing purposes. However, when I convert the QR code, the black turns into white and the white turns into black.

This is the code I'm using:
$i = new Imagick($imgFileName);
$i->setImageFormat('jpg');
$i->setImageColorspace(Imagick::COLORSPACE_GRAY);
$i->writeImage($newFileName);

I'm also attaching a before and after of the color space conversion.

Do you know why the colors are reversing? User generated image User generated image
ASKER CERTIFIED SOLUTION
Avatar of shobinsun
shobinsun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi,

I got the same converted image after using your code, that is both the images are same in my case. May be you have to check the GD library information for this.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial