Chapter Contents

Previous

Next
Image Data Model: _dither

Image Data Model: _dither



Reduces the number of colors in a color image to the colors in a specified color map


Syntax
Details
Example

Syntax

CALL SEND (object-id, '_dither', cmap-id<,option>);

Argument Type Description
cmap-id N the identifier of the image color map that is used to reduce the number of colors in the image
option C can be set to:
FS_NORMAL exhaustively searches the color map for the closest color match
FS_FAST uses fast color searching algorithms to find a close color, but not necessarily the closest.
FS_FASTER uses faster color searching algorithms to find a close color, but not necessarily the closest. The faster the search, the less accurate the color match might be.
FS_FASTEST uses the fastest color searching algorithms to find a close color, but not necessarily the closest. The faster the search, the less accurate the color match might be.

This is the default value.



Details

Like the _mapColors method, _dither reduces the number of colors in an image. Unlike the _mapColors method, _dither attempts to choose colors by looking at pixels in groups, not as single pixels, and tries to choose groups that result in the appropriate color. This is similar to the half-toning algorithm used by print vendors to show multiple colors using only four ink colors. This method is much more computationally expensive than the other color reduction methods, but creates crisper continuous-tone images.


Example

This example dithers an image to 128 shades of gray:

call send (cmap_id, '_generateGrayRamp',
           128);
call send (imgdat_id, '_dither', cmap_id);


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.