The WRITE_SRF procedure writes an image and its color table vectors to a Sun Raster File (SRF).

WRITE_SRF only writes 32-, 24-, and 8-bit-deep rasterfiles of type RT_STANDARD. Use the UNIX command rasfilter8to1 to convert these files to 1-bit deep files. See the file /usr/include/rasterfile.h for the structure of Sun rasterfiles.

This routine is written in the IDL language. Its source code can be found in the file write_srf.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

WRITE_SRF, Filename [, Image, R, G, B]



A scalar string containing the full pathname of the SRF to write.


The array to be written to the SRF. If Image has dimensions (3, n,m ), a 24-bit SRF is written. If Image is omitted, the entire current graphics window is read into an array and written to the SRF file. Image should be of byte type, and in top to bottom scan line order.

R, G, B

The Red, Green, and Blue color vectors to be written to the file. If R , G , B values are not provided, the last color table established using LOADCT is included. If no color table has been established, WRITE_SRF calls LOADCT to load the grayscale entry (table 0).



Set this keyword to write the image from the top down instead of from the bottom up. This setting is only necessary when writing a file from the current IDL graphics window; it is ignored when writing a file from a data array passed as a parameter.


Set this keyword to write a 32-bit file. If the input image is a true color image, dimensioned (3, n, m ), it is normally written as a 24-bit raster file.


Create a pseudo screen dump from the current window:

WRITE_SRF, 'test.srf', TVRD()

See Also