The purpose of this program is to resize a raster file according to instructions from the user. It was designed specifically to resize the extremely large raster files created by IDL's function graphics commands from within an IDL program. It requires ImageMagick be installed and able to be called from a SPAWN command from within IDL.
- rasterfile in required type=string
Set this parameter to the name of the raster file to be resized. The resized file will have this same name unless the
KEEP_ORIGINALkeyword is set, in which case an "_rs" will be appended to the base name given by this parameter.
- percentage in optional type=float
A resize percentage. A value of 50, for example, will make the output file half its original size. A file may be made bigger by specifying a percentage greater than 100 (e.g. 150). The default is to calculate a precentage that makes the longest dimension of the output file approximately 600 pixels.
- KEEP_ORIGINAL in optional type=boolean
Set this keyword to keep the original file. Otherwise, the file is overwritten with the resized file. If this keyword is set, the output file will use the same name as the input file, except an "_rs" will be appended to the base name of the input file.
- HEIGHT in optional type=integer
Set this keyword to set the height of the resulting raster file in pixel units. The width of the raster will be such as to preserve the aspect ratio of the starting image. This keyword cannot be used if the
WIDTHkeyword is used at the same time.
- SILENT in optional type=boolean default=0
Set this keyword to suppress printed output from the program.
- WIDTH in optional type=integer
Set this keyword to set the resulting width of the raster file. The height of the raster will be such as to preserve the aspect ratio of the starting image. This keyword cannot be used if the
HEIGHTkeyword is used at the same time.
Here is how to use this program:
IDL> cgResizeRaster, 'picture.png', /Keep_Original, Width=500
FANNING SOFTWARE CONSULTING:
David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: email@example.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com
Copyright (c) 2014, Fanning Software Consulting, Inc.
Written, 15 January 2014 by David W. Fanning.
|Modification date:||Fri Mar 27 11:07:38 2015|