DynaPDF Manual - Page 81

Previous Page 80   Index   Next Page 82

Color spaces
Page 81 of 839
2
DeviceN color spaces with 2 color components can be used
with 1 bit images without a color table.
3
The image color space can be any 3 channel color space with
exception of Lab.
4
The image data must be defined in DeviceCMYK.
up to 32
Images with more than 4 color components are supported by
InsertRawImage() only.
Special treatment of 1 bit images
1 bit images without a color table are treated as an image mask if image transparency is enabled (see
SetUseTransparency()). In this case black pixels are drawn in the current fill color while white pixels
produce no visible output. The fill color can be defined in an arbitrary color space.
If image transparency is disabled the active color space will be assigned to the image as long as it is
compatible to the image color space which is usually DeviceGray. Note that a 1 bit image with a
color table is treated as a color image. However, this format is unusual and not supported by all
devices and Acrobat versions. The usage of this image format should be avoided if possible.
How to preserve the image color space?
The default conversion rules can be changed if necessary with SetGStateFlags(). The most important
flag is gfUseImageColorSpace. If set, the color space is taken from the image file and the active color
space is ignored.
Another important flag is gfIgnoreICCProfiles. If set, an ICC profile available in the image file is not
used to create an ICCBased color space for the image. The image is inserted in the base color space in
this case. This flag is not meaningful is the flag gfUseImageColorSpace is absent.
The creation of ICCBased color spaces should only be enabled if it is known that the image contains
an ICC profile that is compatible to the output device.
Note that many PDF workflows are not able to replace the ICC profile of an ICCBased color space
and this can cause big problems if an image contains a profile that is not compatible to the output
device.
It is usually better to add a global rendering intent to the document (see AddRenderingIntent())
instead of using automatically created ICCBased color spaces on a per image basis.
A rendering intent is essentially the same as an ICCBased color space but it is used for all images in
the file, as well as for text and vector graphics, which are defined in the underlying base color space.
The advantage is that the ICC profile of a rendering intent can be easily replaced with another one
and this change affects the entire document. The entire document should of course be created in the
same base color space, e.g. DeviceCMYK, DeviceRGB, DeviceGray, or Lab.
 

Previous topic: Color Spaces and Images, Handling of non-device color spaces

Next topic: Image Resolution