Image processing of extracted images

Q:
Thanks for the advice regarding using the CTM for applying a transform
to
the extracted image. I was able to transform the extracted image to
match
the display image. I also rebuilt our image processing library as a set
of
DLLs to avoid any possible conflicts with PDFNet.

The extracted image must have same appearance as the displayed image.
The
next requirement is to apply operations specified by the PDF file to
the
extracted, transformed image. For example, the PDF may display a
greyscale
image, while the extracted image is in colour. What is the best method
to
obtain the properties indicating that such operations (ie. greyscale
conversion) are required?

Are these attributes obtained from Image::GetImageColorSpace() and
Image::GetImageRenderingIntent()? Is it a matter of examining each
returned
value and using it to determine which operations are necessary?
----
A:
Yes, you can use Image class to obtain the extra information about any
image in PDF, but I am not sure what additional transformations you
need to apply. PDF doesn't dynamically convert images from one color
space to another (e.g. RGB image is not converted to grayscale - unless
you are writing some kind of a specialized PDF processor).
Image::GetImageRenderingIntent() is a hint for Color Management Module
(CMM) when performing color conversion. Unless you are color-converting
images on your end you can probably ignore this parameter.

Should an image displayed in a PDF document have the same
appearance as the extracted image.

This is a bit tricky question. In general, yes, the extracted image can
be used to render page content as it is displayed in a PDF viewer (such
as PDFView that comes as part of PDFNet), but you need to understand
and apply rules of PDF renderig model. First you would need to apply
image transformation (to accout for CTM) that may rotate or scew the
image. Also, in PDF there may be additional content drawn on top of (or
under) the image. Also, PDF images may be associated with a soft or
image mask for transparency effects. PDF images may also have some
function objects (e.g. halftone, background removal, etc) as part of
the color space, that may alter image color samples and change the way
image is viewed (these cases are quite rare).

Is it possible for an image to be covered by a different
"layer", possibly grayscale, which may in turn lead us to
view the image as being displayed in grayscale but extracted
in colour?

PDF doesn't support filter effects like SVG, however it is probably
possible to hack similar effects using above mentioned functions
objects (which can be part of some color spaces). So yes, there may be
cases when the image displayed in PDF viewer is very different from the
embedded (source) image.