CMYK colors inverted with draw or annotate
Posted: 2010-06-29T15:41:30-07:00
I need to draw some text over a pre-existing image that was saved as CMYK (the final output is for printing). When I specify the fill color for the text, I get it's color compliment (e.g., if I say fill white, I get black ... and vice versa).
If I use annotate, I get the same result.
I've tried using -set colorspace RGB, but then the original CMYK images colors are inverted.
I've created a small self-contained test that demonstrates this:
convert -size 150x150 -border 2x2 xc:"cmyk(0%, 0%, 0%, 0%)" -colorspace cmyk -draw "fill black circle 75,75,75,20 " test.jpg
.... or this one using annotate:
convert -size 200x200 xc:"cmy(0%, 0%, 0%)" -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
(using cmy, or cmyk I get the same results)
The 150x150 square is white (cmyk = 0,0,0,0), as it should be, but the drawn circle is also white (even though I specified black). If I change fill black to fill white, I get a black circle.
.... or in the second case ....
The annotated text is correctly white, but the 200 by 200 square has been inverted to black (even though cmy(0,0,0) should be white. If I specify colorspace as cmy, it stays the same:
convert -size 200x200 xc:"cmy(0%, 0%, 0%)" -colorspace cmy -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
But if I specify the color space as cmyk and make my original square cmyk, I get the correct white square, but then the annotated text is black.
convert -size 200x200 xc:"cmyk(0%, 0%, 0%, 0%)" -colorspace cmyk -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
I cannot for the life of me find the magic settings that will make both objects' colors behave.
No matter what I do, either one (the original image, or the added - drawn or annotated - part) has it's colors inverted.
How can I draw or annotate a CMYK image and not get inverted colors when I do?
(Windows XP SP3 - ImageMagick 6.5.8-3 2009-11-28 Q16)
Chuck
If I use annotate, I get the same result.
I've tried using -set colorspace RGB, but then the original CMYK images colors are inverted.
I've created a small self-contained test that demonstrates this:
convert -size 150x150 -border 2x2 xc:"cmyk(0%, 0%, 0%, 0%)" -colorspace cmyk -draw "fill black circle 75,75,75,20 " test.jpg
.... or this one using annotate:
convert -size 200x200 xc:"cmy(0%, 0%, 0%)" -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
(using cmy, or cmyk I get the same results)
The 150x150 square is white (cmyk = 0,0,0,0), as it should be, but the drawn circle is also white (even though I specified black). If I change fill black to fill white, I get a black circle.
.... or in the second case ....
The annotated text is correctly white, but the 200 by 200 square has been inverted to black (even though cmy(0,0,0) should be white. If I specify colorspace as cmy, it stays the same:
convert -size 200x200 xc:"cmy(0%, 0%, 0%)" -colorspace cmy -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
But if I specify the color space as cmyk and make my original square cmyk, I get the correct white square, but then the annotated text is black.
convert -size 200x200 xc:"cmyk(0%, 0%, 0%, 0%)" -colorspace cmyk -pointsize 40 -fill white -annotate +25+70 'Sammy' test.jpg
I cannot for the life of me find the magic settings that will make both objects' colors behave.
No matter what I do, either one (the original image, or the added - drawn or annotated - part) has it's colors inverted.
How can I draw or annotate a CMYK image and not get inverted colors when I do?
(Windows XP SP3 - ImageMagick 6.5.8-3 2009-11-28 Q16)
Chuck