Strange behavior with CMYK JPEGs in PDFs
Posted: 2011-01-26T09:28:26-07:00
Hi guys
I'm developing a program wich extracts and modifies images in PDF files. I´ve noticed a strange behavior when I try to load JPEG images with CMYK colorspaces and try to convert them to RGB images. The colors are completely wrong. To change the colorspace I simply saved the image as a BMP file.
I use this code:
This results in this images:
cmyk.jpg displayed in windows explorer
rgb.bmp displayed in windows explorer
original image in pdf
What can be my mistake?
Thank you for any help!
I'm developing a program wich extracts and modifies images in PDF files. I´ve noticed a strange behavior when I try to load JPEG images with CMYK colorspaces and try to convert them to RGB images. The colors are completely wrong. To change the colorspace I simply saved the image as a BMP file.
I use this code:
Code: Select all
string img = obj->Stream(); //img contains the image data
Blob * blob = new Blob((const void*)img.c_str(),img.length());
Image * image = new Image(*blob);
image->write("cmyk.jpg");
image->write("rgb.bmp");
cmyk.jpg displayed in windows explorer
rgb.bmp displayed in windows explorer
original image in pdf
What can be my mistake?
Thank you for any help!