Page 1 of 1

CMYK to sRGB with command line

Posted: 2010-05-06T12:48:48-07:00
by BeckhamStZ
Hi.
How can I convert CMYK color to sRGB with profiles from command line. I use this :
convert -size 1x1 xc:"cmyk(0,100,100,0)" -profile CMYK.icc -profile sRGB.icc -colorspace RGB txt:
and the result is
# ImageMagick pixel enumeration: 1,1,65535,rgb
0,0: (63916,44053,37284) #F9ACAC1591A4 rgb(97.5296%,67.2206%,56.8917%)
I want to get RGB value in INT from 0 to 255. Can someone help me?

Re: CMYK to sRGB with command line

Posted: 2010-05-06T13:12:06-07:00
by snibgo
I'm not sure exactly what you want, but putting "-depth 8" before "txt:" might do it.

Re: CMYK to sRGB with command line

Posted: 2010-05-06T13:16:46-07:00
by BeckhamStZ
thanks, I get the rgb value from 0 to 255 but not correct.
when convert cmyk(0,100,100,0) to rgb it return value #F9AB91 which is not correct.

Re: CMYK to sRGB with command line

Posted: 2010-05-06T13:28:42-07:00
by snibgo
What is the correct value?

Did you mean "cmyk(0,100%,100%,0)" ?

Re: CMYK to sRGB with command line

Posted: 2010-05-06T14:21:17-07:00
by BeckhamStZ
thanks a lot when change to percent everything is okey!

Re: CMYK to sRGB with command line

Posted: 2010-05-06T15:42:57-07:00
by fmw42
in general when you use profiles with images, i don't think you want to add -colorspace RGB. see http://www.imagemagick.org/Usage/formats/#profiles

However that may be necessary to tell txt: what colorspace to output its textual data?

I have not tested that, though.