Commands Used with the IMGCTRL, IMGOP and PICFILL Functions |
Converts an image to the specified image type and depth
rc=IMGOP(task-id, 'CONVERT', type);
|
-
type
-
specifies the type of image to convert to:
-
'GRAY'
-
a monochrome (black and white) image
-
'CMAP'
-
a color-mapped image
-
'RGBA'
-
an RGB image
Type: Character
CONVERT performs dithering, quantizing,
and other operations in order to reduce an image to a simpler form. It can
also create a two-color (black and white) RGB image by converting a monochrome
image to an RGBA image. Images that are originally gray-scale or black and
white cannot be colorized. CONVERT acts on the currently selected image.
Convert an RGB image to a dithered monochrome image:
rc=imgop(task-id,'READ','rgb.tif');
rc=imgop(task-id,'CONVERT','GRAY');
rc=imgop(task-id,'WRITE','gray.tif');
Convert the GRAY image back to RGB. Because all color
information is lost, the final RGB image has only two colors:
rc=imgop(task-id,'READ','gray.tif');
rc=imgop(task-id,'CONVERT','RGBA');
rc=imgop(task-id,'WRITE','rgb.tif');
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.