Chapter Contents

Previous

Next
SAS Component Language: Reference

Attributes for Reading and Writing Files

Reader Attributes for Supported File Types describes the attributes for the image readers that are supported. Attributes for image writers are described in Writer Attributes for Supported File Types.

When you are reading images, include the FORMAT= attribute in the method if

FORMAT= is not required in other cases, but it is always more efficient to specify it.

When you are writing images, you must specify the FORMAT= attribute if the LNAMEMK SCL function is not used to include the FORMAT= attribute as part of the image pathname specified for the image-path argument in the method.

You can specify an image file's attributes in SCL functions by enclosing the attributes in quotation marks and separating multiple attributes with blanks. For example:


rc=imgop(tid,"WRITE",filename,
           "FORMAT=TIFF
           COMPRESS=G3FAX"):

Reader Attributes for Supported File Types
File Type Reader Attributes Comment
BMP FORMAT=BMP


COMPRESS=NONE default

COMPRESS=RLE run-length encoded data
CAT FORMAT=CAT
DIB FORMAT=DIB supported only under the Windows 3.1, Windows NT, Windows 95, and OS/2 operating systems
EMF FORMAT=EMF supported only under Windows NT and Windows 95
EPSI FORMAT=EPSI

DPI=num
number of dots per inch specified when the output file was created
GIF FORMAT=GIF
JFIF FORMAT=JFIF required for reading JPEG files that use JPEG File Interchange Format (JFIF)

DCT=mode specifies 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 is useful for viewing on monochrome displays. The reader runs noticeably faster in this mode.

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

FAST enables certain recommended processing options for fast, low quality output; equivalent to enabling ONEPASS, DITHER=ORDERED, COLORS=216, NOSMOOTH, and DCT=FAST.

NOSMOOTH uses a faster, lower quality, upsampling routine.

ONEPASS uses a one-pass color quantization instead of the standard two-pass quantization. The one-pass method is faster and requires less memory, but it produces a lower-quality image. This attribute is ignored unless you also specify the COLORS attribute. ONEPASS is always enabled for gray-scale output.

COLORS=n
reduces the number of colors in the image to at most n colors; n must be between 2 and 256, inclusive

SCALE_RATIO=n
scales the output image by a factor of 1/n. Currently the scale factor must be 1/1, 1/2, 1/4, or 1/8. This is useful when processing a large image and only a smaller version is needed, because the reader is much faster when the output is scaled down.

DITHER=mode
specifies which type of dithering to use for color quantization; mode can be


FS Floyd-Steinberg dithering


ORDERED ordered dithering


NONE no dithering.
MET FORMAT=MET supported only under OS/2
PBM FORMAT=PBM

PCD FORMAT=PCX FORMAT=PCD RES= specifies the image resolution to be read. Photo CD images have multiple resolution images in each image. Values are




BASE/64 64x96


BASE/16 128x192


BASE/4 256x384


BASE 512x768 (default)


4BASE 1024x1536


16BASE 2048x3072
PICT FORMAT=PICT supported only by the Macintosh environment
PNG FORMAT=PNG

TGA FORMAT=TGA

TIFF FORMAT=TIFF

WMF FORMAT=WMF supported only under Windows operating systems
XBM FORMAT=XBM

XPM FORMAT=XPM supported only by the X Window System under UNIX
XWD FORMAT=XWD


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 3.1, Windows NT, Windows 95, and OS/2 operating systems
EMF FORMAT=EMF supported only under Windows NT and Windows 95
EPSI FORMAT=EPSI
GIF FORMAT=GIF
JFIF FORMAT=JFIF required for writing JPEG files that use 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 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 off 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 im age 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. Too large a smoothing factor 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; use 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; used 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 doesn't support a real PostScript reader.

PREWIDTH=x

PREHEIGHT=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 output page width in pixels (default: 612, typical 8.5-inch page)

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

NOFIT turns off the default of scaling an oversized image down 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 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.