IMG_INSIMG Name
IMG_INSIMG Purpose
Insert a subimage into an 24-bit color image.
Category
Calling Sequence
out = img_insimg(base,sub) Inputs
base = Original image. in
sub = Sub image to insert. in
Keyword Parameters
Keywords
XSTART=ix, YSTART=iy lower left corner
of inserted image (def=0).
CHANNELS=chan Color channels to insert (def='RGB').
Insert channels from sub into base.
May insert one or more color channels, like R,G,B for
the Red, Green, and Blue color components. Or
H,S,V for Hue, Saturation, and Value. May not mix
RGB and HSV. For example, to colorize img0 based on
imgc: out=img_insimg(img0,imgc,chan='HS')
LOX=lox, HIX=hix Min and Max x pixels to use from sub.
LOY=loy, HIY=hiy Min and Max y pixels to use from sub.
Default is to use all of sub image.
The substituted channels may be weighted:
RWT=rwt, GWT=gwt, BWT=bwt RGB weights (0-1, def=1).
HOFF=hoff, SWT=swt, VWT=vwt H offset (def, def=0),
S weight (0-1, def=1), V weight (0-1, def=1).
VMULT=vmult Multiply base image brightness by sub
image brightness, vmult is a weighting factor:
0=no change, 1=max change.
VMIX=vmix mix base image and subimage values (brightness).
vmix=0 means all base img (def), 1 means all sub image.
Only one of VWT or VMIX may be used. Must also include
V in the CHANNELS keyword for VMIX or VWT to work.
Outputs
out = Resulting image. out
Common Blocks
Notes
Notes: if sub image is too big to fit inside base image
it is clipped to fit. Works for single channel (B&W)
images but none of the channel keywords apply.
Modification History
R. Sterner, 2001 Jun 25
R. Sterner, 2002 May 17 --- Fixed a V bug.
R. Sterner, 2002 May 20 --- Rewrite to simplify.
R. Sterner, 2006 Jul 17 --- Now works for B&W images (single channel).
R. Sterner, 2010 May 04 --- Converted arrays from () to [].
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.