I am attempting to convert RGB images to CMYK. The process is to get
the image data using Element.GetImageData(), read it into the array
using the FilterReader, then loop throuh each pixel and convert the
input r,g,b values to output c,m,y,k values. As I am converting I am
writing the output pixels to a new output array (which has the size of
((orig_image_width * orig_image_height) * 4). Checking the output
pixel data, it looks to be correct. Once all of the data has been
converted, I am creating a new image using the following code:
Dim pdfimage2 As Image = Image.Create(inputDoc,
replacementImage_Data_Out, imageWidth, imageHeight,
Where replacementImage_Data_Out is my new output data array.
I follow that with the following code block:
newImageElement = eb.CreateImage(pdfimage2)
' ' Swap the old image with a new one...
Then do a save once all is finished. The resulting PDF file has my
new image, with a CMYK colorspace, in the correct size and position,
but the color looks like it is at about a 50% fill. Does anyone have
any idea what may be happening or what I might be doing wrong? I've
check the image data stream after of the new pdf image, and the values
of the raw data look correct, but on screen it is way off.