Chapter Contents

Previous

Next
CONVERT

CONVERT



Converts an image to the specified image type and depth


Syntax
Details
Example

Syntax

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


Details

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.


Example

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');


Chapter Contents

Previous

Next

Top of Page

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