ImageMagick Version: ImageMagick 6.3.3 04/21/07 Q16 (Win32 on Vista x64)
imagick module version 2.0.0-rc1
PHP Version 5.2.4
I have run into a few issues attempting to annotate an 8-bit TIFF file. UsingImageMagick 6.3.6 Q16 with and without imagick. I was never able to get CMYK color values i.e. "cmyk(100%,0,0,100)" for cyan. It interprets the fist three items and uses them in an RGB type color scheme. Instead of cmyk(100%,0,0,0) being cyan, it show up as a true red as would be expected in rgb(255,0,0) represented as C:0%,Y:100%,M:100%,K0%
Code Below:
Command Line:
convert base-business-card.tif -font arial -pointsize 52 -fill cmyk(255,0,0,0) -draw "text 200 200 'This is a test'" new.tif
PHP Code:
$fontdir = getcwd().'/fonts';
$imgdir = getcwd().'/images';
$imagick = new Imagick($imgdir.'/base-business-card.tif');
$imagickDraw = new ImagickDraw();
$imagickPixel = new ImagickPixel();
$imagick->setImageColorspace(Imagick::COLORSPACE_CMYK);
$imagickPixel->setColor('cmyk(100%,0,0,0'));
$imagickDraw->setFillColor($imagickPixel);
$imagickDraw->setStrokeColor($imagickPixel);
$imagickDraw->setFont($fontdir.'/arial.ttf');
$imagickDraw->setFontSize(52);
$imagick->annotateImage($imagickDraw,200,200,0,'This is a test');
header( "Content-type: " . $imagick->getImageType() );
print $imagick->getImageBlob();
CMYK Pixel Color Set Issue
CMYK Pixel Color Set Issue
- Attachments
-
- base-business-card.zip
- File used in code sample zipped for compression
- (8.19 KiB) Downloaded 1200 times
Re: CMYK Pixel Color Set Issue
Im having the same issue, red is blue, blue is orange..this sucks
Re: CMYK Pixel Color Set Issue
Drawing and text annotation requires the RGB color model. Convert your CMYK image to RGB, annotate it, and then convert it back from RGB to CMYK.