IMG_MERGE
Name
IMG_MERGE
Purpose
Merge color components into a 24-bit color image.
Category
Calling Sequence
img = img_merge(c1, c2, c3)
Inputs
c1 = color component 1. in
c2 = color component 2. in
c3 = color component 3. in
Keyword Parameters
Keywords
/HSV means color components are HSV (def RGB).
TRUE=tr Specify dimension to interleave (1, 2, or 3=def).
For tr=0 the first component is returned (avoid /HSV).
NX=nx, NY=ny Returned image dimensions.
ALPHA=a Give an alpha channel (def=none).
0 is full transparency, 255 is no transparency.
ERROR=err error flag: 0=ok, 1=input not 2-D, 3=# dimension vary.
Outputs
img = Output image. out
By default c1,c2,c3 = Red, Green, Blue.
/HSV means c1, c2, c3 = Hue, Saturation, Value.
Common Blocks
Notes
Note: input color components are 2-D.
1-D arrays are treated like a NX x 1 arrays.
1-D color arrays may require a trailing dimension of 1.
The alpha channel is a byte array with the same dimensions
as the image components. It may be used to control the
image transparency and may be set from 0 (image is
completely transparent at that point so not visible) to 255
(image is not transparent at that point so completely
visible) or anywhere in between. To save the result as a
PNG image make sure to use TRUE=1 (default if an alpha is
given). The result will be bytarr[4,nx,ny] and may be
saved using the IDL routine write_png:
write_png, filename, img
Modification History
R. Sterner, 2001 Jun 21
R. Sterner, 2009 Jul 15 --- Handled true=0 case.
R. Sterner, 2010 May 04 --- Converted arrays from () to [].
R. Sterner, 2010 Sep 08 --- Now allows 1-D arrays.
R. Sterner, 2011 May 12 --- Handled Alpha channel.
Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.