PixelSetColor problem with CMYK images
Posted: 2009-09-30T07:51:29-07:00
Hello,
I have a problem where PixelSetColor seems to set the wrong color when using CMYK images.
When using RGB values as rgb(r,g,b) the colors seem to either be CMYK values, or not work at all.
In the sample program shown, rgb(255,0,0) produces Cyan text.
Any help with this would be appreciated.
Here is my sample code:
#include "wand/MagickWand.h"
int main() {
char *file = "cmyk.jpg"; /* this must be a CMYK file */
char *output_file = "out.pdf";
MagickWand *image = NewMagickWand();
DrawingWand *draw = NewDrawingWand();
PixelWand *pixel = NewPixelWand();
MagickReadImage(image, file);
PixelSetColor(pixel, "rgb(255,0,0)");
DrawSetFillColor(draw, pixel);
DrawAnnotation(draw, 100, 100, "hello");
MagickDrawImage(image, draw);
MagickWriteImage(image, output_file);
return 0;
}
I have a problem where PixelSetColor seems to set the wrong color when using CMYK images.
When using RGB values as rgb(r,g,b) the colors seem to either be CMYK values, or not work at all.
In the sample program shown, rgb(255,0,0) produces Cyan text.
Any help with this would be appreciated.
Here is my sample code:
#include "wand/MagickWand.h"
int main() {
char *file = "cmyk.jpg"; /* this must be a CMYK file */
char *output_file = "out.pdf";
MagickWand *image = NewMagickWand();
DrawingWand *draw = NewDrawingWand();
PixelWand *pixel = NewPixelWand();
MagickReadImage(image, file);
PixelSetColor(pixel, "rgb(255,0,0)");
DrawSetFillColor(draw, pixel);
DrawAnnotation(draw, 100, 100, "hello");
MagickDrawImage(image, draw);
MagickWriteImage(image, output_file);
return 0;
}