The EXPAND procedure shrinks or expands a two-dimensional array, using bilinear interpolation. It is similar to the CONGRID and REBIN routines.
This routine is written in the IDL language. Its source code can be found in the file expand.pro in the lib subdirectory of the IDL distribution.
Example
Copy and paste the following example code to see EXPAND in action on a JPG image.
file = FILEPATH('rbcells.jpg', $
SUBDIR=['examples', 'data'])
READ_JPEG, file, img
EXPAND, img, 864, 778, img2
a1 = IMAGE(img, LAYOUT=[2,1,1])
a2 = IMAGE(img2, LAYOUT=[2,1,2], /CURRENT)
EXPAND, img, 432, 1200, img3
EXPAND, img, 1500, 389, img4
b1 = IMAGE(img3)
b2 = IMAGE(img4)
Syntax
EXPAND, A, Nx, Ny, Result [, FILLVAL=value] [, MAXVAL=value]
Arguments
A
A two-dimensional array to be magnified.
Nx
Desired size of the X dimension, in pixels.
Ny
Desired size of the Y dimension, in pixels.
Result
A named variable that will contain the magnified array.
Keywords
FILLVAL
Set this keyword equal to the value to use when elements larger than MAXVAL are encountered. The default is -1.
MAXVAL
Set this keyword equal to the largest desired value. Elements greater than this value are set equal to the value of the FILLVAL keyword.
Version History
See Also
CONGRID, REBIN