Page 1 of 1

Generating CMYK text

Posted: 2012-11-26T18:10:05-07:00
by semiadam
I am trying to generate CMYK text with accurate values for C,M,Y,K channels to be used in a printing project. However after using this command:

Code: Select all

 convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 -colorspace cmyk label:TEST 1.jpg
when I open the file in Photoshop the CMYK values I see are: (0,25,47,52). I'm thinking maybe IM converts CMYK values to RGB when generating text and then converts it back to CMYK after -colorspace switch and since CMYK<->RGB is not a 1-to-1 mapping this shift happens (not sure though). Does anyone know how I can generate and output text (and other elements) while keeping the exact CMYK values?

Thanks.

Re: Generating CMYK text

Posted: 2012-11-26T18:42:05-07:00
by fmw42
convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 -colorspace cmyk label:TEST 1.jpg
try changing the order of your options so you create the label image before changing colorspace

convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 label:TEST -colorspace cmyk CMYK.icc 1.jpg
I'm thinking maybe IM converts CMYK values to RGB when generating text and then converts it back to CMYK after -colorspace switch
My understanding is that this is a correct assumption. You probably would be better using a profile than -colorspace. Something like:

convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 label:TEST -profile sRGB.icc -profile CMYK.icc 1.jpg

(or try USWebCoatedSWOP.icc in place of CMYK.icc)

But I cannot guarantee that will work perfectly either. I do not know how IM converts cmyk to sRGB in the fill command. So that may be different than either -colorspace cmyk or with profiles as there are many profiles for both sRGB and CMYK, I suspect.

Re: Generating CMYK text

Posted: 2012-11-28T13:19:34-07:00
by semiadam
Unfortunately it didn't work.

Re: Generating CMYK text

Posted: 2012-11-28T13:45:28-07:00
by fmw42
fmw42 wrote:convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 label:TEST -colorspace cmyk CMYK.icc 1.jpg
Oops. I made an error here and left in CMYK.icc. It should have been

Code: Select all

convert -fill "cmyk(20%,30%,40%,10%)" -pointsize 100 label:TEST -colorspace cmyk 1.jpg
I don't know if that will make an difference or not.

If this or the command using profiles does not work, then I am at a loss to know what else to try. Sorry.