VpeSetPictureExportDither

<< Click to Display Table of Contents >>

Navigation:  Picture Export >

VpeSetPictureExportDither

Previous pageReturn to chapter overviewNext page

[Windows platform only, Professional Edition and above]

Specifies, if an exported image shall be dithered to a lower color resolution when written to file. This is very useful, if you want to export smaller images (regarding their size in bytes) - or if you want to fax (in b/w) a true-color image - and to keep the visual information at a high quality.

void VpeSetPictureExportDither(

VpeHandle hDoc,

int dither

)

VpeHandle hDoc

Document Handle

int dither

possible values are:

Constant Name

Value

Comment

PICEXP_DITHER_NONE

0

no dithering

PICEXP_DITHER_MONO

1

dither to 1-bit monochrome

PICEXP_DITHER_256

3

dither to 8-bit color

PICEXP_DITHER_256_WU

4

dither to 8-bit color using WU-quantizer

Default:

PICEXP_DITHER_NONE

Remarks:

For PICEXP_DITHER_MONO: images are dithered with the Floyd-Steinberg dithering algorithm. The source bitmap may have any of the following color depths: 1, 4, 8, 16, 24, 32 bits. If the source bitmap is a monochrome bitmap, VPE creates a copy without dithering.

 

For PICEXP_DITHER_256: this only works, if the source bitmap is 24-bit, i.e. PictureExportColorDepth is PICEXP_COLOR_TRUE. Images are not dithered, instead VPE uses color-reduction (NeuQuant neural-net quantization algorithm by Anthony Dekker). This algorithm creates very good results but is rather slow.

 

For PICEXP_DITHER_256_WU: this only works, if the source bitmap is 24-bit, i.e. PictureExportColorDepth is PICEXP_COLOR_TRUE. Images are not dithered, instead VPE uses color-reduction (Xiaolin Wu color quantization algorithm). This algorithm is much faster than the NeuQuant algorithm, but does not create as good results. In some cases it might lead to false colors.

Example:

VpeSetPictureExportColorDepth(hDoc, PICEXP_COLOR_256)

VpeSetPictureExportDither(hDoc, PICEXP_DITHER_MONO)

VpePictureExportPage(hDoc, "test.bmp", 1)

Instructs VPE, to generate from page one of the document internally a 256 color image first, and to dither it down afterwards to b / w (monochrome) when writing it to file.