Chapter Contents |
Previous |
Next |
DITHER |
Syntax | |
Details | |
Example |
Syntax |
rc=IMGOP(task-id, 'DITHER'<, option>); |
region-id=PICFILL(graphenv-id, type, ulr,
ulc, lrr, lrc, source<, 'DITHER'<, arguments>>); |
Details |
DITHER acts on the currently selected image. It dithers an image to the current color map: the one specified by a previous GENERATE_CMAP, STANDARD_CMAP, or GRAB_CMAP command.
Like the MAP_COLORS command, DITHER reduces the number of colors in an image. Unlike the MAP_COLORS command, DITHER attempts to choose colors by looking at pixels in groups, not as single pixels, and tries to choose groups that will result in the appropriate color. This is similar to the half-toning algorithm that print vendors use to show multiple colors with the use of only four ink colors. This command is much more computationally expensive than the other color-reduction commands, but it handles continuous-tone images much better.
Example |
Dither an image:
if (dither=1) then do; rc=imgop(task-id,'GENERATE_CMAP','COLORRAMP', 5,5,4); rc=imgop(task-id,'DITHER'); rc=imgop(task-id,'PASTE'); end;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.