Hello guys. I'm newbie with Imagemagick.
I want to convert CMYK color to RGB color, but many algorithms which I found doesnt work correctly.
( For example CMYK 0 100 100 0 convert to RGB 255 0 0 but in Adobe Photoshop the RGB Value is not this and also the G and B channels aren't zero )
Is there a way to use Imagemagick to get RGB value of Cmyk color?
CMYK to RGB
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: CMYK to RGB
in command line
convert -size 1x1 xc:"cmyk(100,50,25,10)" -colorspace RGB txt:
or
use the color converter at http://www.imagemagick.org/script/color.php
Note: for more exact conversion of a CMYK image to RGB you need to use profiles. see http://www.imagemagick.org/Usage/formats/#profiles
convert -size 1x1 xc:"cmyk(100,50,25,10)" -colorspace RGB txt:
or
use the color converter at http://www.imagemagick.org/script/color.php
Note: for more exact conversion of a CMYK image to RGB you need to use profiles. see http://www.imagemagick.org/Usage/formats/#profiles
Re: CMYK to RGB
I want to use it in php to create text with rgb color from cmyk color. I try with profiles in command line and everything is ok but now in php is not.
this code make a picture not in cmyk ( its in RGB ) and when I get ImagePixel from x=5 y=5 for example his value is rgb(0,100,100)
Where is the problem ?
Code: Select all
$im = new Imagick();
$im->newImage( 100, 100, new ImagickPixel('cmyk(0,100,100,0)'), 'jpeg');
$im->setImageColorSpace(Imagick::COLORSPACE_CMYK);
header('Content-Type: image/jpeg');
echo $im;
Where is the problem ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: CMYK to RGB
Don't know much about Imagick, but try swapping the order of these two lines
Do you know if IMagick allows colors to be specified in CMYK?
Code: Select all
$im->newImage( 100, 100, new ImagickPixel('cmyk(0,100,100,0)'), 'jpeg');
$im->setImageColorSpace(Imagick::COLORSPACE_CMYK);
Re: CMYK to RGB
When swap two lines the result is this ->
Can not process empty Imagick object.
when I add a profiles and call getImageProfiles the returned array is empty.
Can not process empty Imagick object.
when I add a profiles and call getImageProfiles the returned array is empty.
Re: CMYK to RGB
Did you found a solution?