Chapter Contents

Previous

Next
SAS Component Language: Reference

Attributes for Writing Image Files

Writer Attributes for Supported File Types describes the attributes that you can specify for the image writers.

When you are writing images, you must specify the FORMAT= attribute. You can specify this attribute either directly as an argument for the WRITE command or as part of the image-path (if you use the LNAMEMK function to specify the pathname). For example:

/* Specify the FORMAT= attribute directly */
/* as an argument to the WRITE command.   */
rc=imgop(task-id,'WRITE','/user/images/sign.tif', 'format=tiff');

/* Use the LNAMEMK function to specify the image-path, */
/* and include the FORMAT= attribute as part of the path. */
path=lnamemk(5,'mine.images.sign','format=cat');
rc = imgop(task-id,'WRITE',path);

Writer Attributes for Supported File Types
File Type Writer Attributes Comment
BMP FORMAT=BMP
CAT FORMAT=CAT

COMPRESS=G3FAX FAX CCITT Group 3 for monochrome black-and-white images (depth of 1) only.

COMPRESS=G4FAX FAX CCITT Group 4 for monochrome black-and-white images (depth of 1) only.

DESC=desc Desc is a catalog description.
DIB FORMAT=DIB Supported only under the Windows 95, Windows 98, Windows NT, and OS/2 operating systems.
EMF FORMAT=EMF Supported only under Windows 95, Windows 98, and Windows NT.
EPSI FORMAT=EPSI
GIF FORMAT=GIF
JFIF FORMAT=JFIF Required for writing JPEG files that use the JPEG File Interchange Format.

DCT=mode
Specifies which type of Discrete Cosine Transform (DCT) to use when processing the image. Mode can be


INT an integer DCT


FAST a faster and less accurate integer DCT


FLOAT a slightly more accurate method that can be much slower unless the host has very fast floating-point hardware.


The results of the floating-point method can vary across host machines, whereas the integer methods should give the same results on all hosts.

GRAYSCALE Produces a gray-scale image even if the JPEG file is in color. This option is useful for viewing on monochrome displays. The reader runs noticeably faster in this mode.

VERSION Writes to the SAS log the version number and copyright messages for the Independent JPEG Group's JFIF software.

BASELINE Generates a baseline JPEG file even for low-quality settings.

OPTIMIZE Optimizes the entropy encoding parameters. This usually results in a smaller JPEG file, but writer processing is longer and more memory is needed. Image quality and speed of decompression are not affected.

PROGRESSIVE Produces a progressive JPEG file in which the data is stored in multiple scans of increasing quality. This option is useful if the file is being transmitted over a slow communications link and the decoder can display each scan as it is received.

QUALITY=n
Scales the quantization tables to adjust for image quality. N must be in the range 0...100. 0 is worst; 100 is best; the default is 75. This option lets you trade file size for quality of the reconstructed image. Normally, you want to use the lowest quality setting that results in an image that is visually indistinguishable from the original image. The optimal value will vary from image to image.

SMOOTH=n
Specifies the strength of the smoothing filter to eliminate dithering noise. N must be in the range 0...100. The default is 0, which disables smoothing. A smoothing factor that is too large blurs the image.
MET FORMAT=MET Supported only under OS/2.
PBM FORMAT=PBM

COMPRESS=NONE Text PBM file (default).

COMPRESS=BINARY Binary PBM file.

COMPRESS=RAW Binary PBM file.
PCL FORMAT=PCL

DPI=num Number of dots per inch to be used in the output file.

EPS Does not reset the printer margins. You can use this option to embed an image into another PCL document.
PICT FORMAT=PICT Supported only in the Macintosh environment.
PNG FORMAT=PNG
PS FORMAT=PS

COMPRESS=NONE Default for color images.

COMPRESS=RLE Run-length encoded; default for gray-scale images.

DPI=num
Number of dots per inch to be used in the output file.

EPS Does not reset the printer margins. You can use this option to embed an image in another PCL document.

PREVIEW Specifies whether a scaled-down, 1-bit, black-and-white preview image is written into the encapsulation header. The preview image enables this file to be read by software (such as SAS) that does not support a real PostScript reader.

PREWIDTH=xPREHEIGHT=y Size of the preview image in pixels if PREVIEW is specified (default: 25% of original size).

XSCALE Directly sets width scaling (default: calculate it).

YSCALE Directly sets height scaling (default: calculate it).

PAGEX Sets the output page width in pixels (default: 612, typical 8.5-inch page).

PAGEY Sets the output page height in pixels (default: 792, typical 11-inch page).

NOFIT Turns off the default of scaling down an oversized image to fit the page. Must be used with XSCALE and YSCALE.
TIFF FORMAT=TIFF

COMPRESS=NONE Default.

COMPRESS=G3FAX FAX CCITT Group 3 for monochrome black-and-white (depth of 1) images only.

COMPRESS=G4FAX FAX CCITT Group 4 for monochrome black-and-white (depth of 1) images only.
WMF FORMAT=WMF Supported only under MicroSoft Windows operating systems.
XBM FORMAT=XBM Supported for writing only from interactive windows under UNIX.
XPM FORMAT=XPM Supported only on the X Window System under UNIX.


Chapter Contents

Previous

Next

Top of Page

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