CMYK to sRGB with command line

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
BeckhamStZ

CMYK to sRGB with command line

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CMYK to sRGB with command line

Post by snibgo »

I'm not sure exactly what you want, but putting "-depth 8" before "txt:" might do it.
snibgo's IM pages: im.snibgo.com
BeckhamStZ

Re: CMYK to sRGB with command line

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CMYK to sRGB with command line

Post by snibgo »

What is the correct value?

Did you mean "cmyk(0,100%,100%,0)" ?
snibgo's IM pages: im.snibgo.com
BeckhamStZ

Re: CMYK to sRGB with command line

Post by BeckhamStZ »

thanks a lot when change to percent everything is okey!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK to sRGB with command line

Post 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.
Post Reply