Combine two or more images into a single image.
IMCOMBINE(img1, img2, ..., imgN, direction, order, bg)
imgN |
- |
Two or more arrays, the input images. |
||||
direction |
- |
Optional. An integer, the combination direction.
|
||||
order |
- |
Optional. An integer, the combination order.
|
||||
bg |
- |
Optional. An integer, a color index for the background color of unequal sized images. Defaults to 15, WHITE.. |
A single combined RGB image.
W1: readimage(gethome + "\data\kasha.jpg");scalesoff
W2: W1;turbo;setaspect(-1);scalesoff
W3: W1;paruline;setaspect(-1);scalesoff
W4: imcombine(W1, W2, W3);scalesoff
W5: imcombine(W1, W2, W3, 0, 1);scalesoff

W1 loads a color JPEG image.
W2 sets the image shading to TURBO.
W3 sets the image shading to PARULINE.
W4 horizontally combines the 3 images into a single image.
W5 also horizontally combines the 3 images into a single image, except the images are ordered right to left.
W1: readimage(gethome + "\data\kasha.jpg");scalesoff
W2: W1;turbo;setaspect(-1);scalesoff
W3: W1;paruline;setaspect(-1);scalesoff
W4: imcombine(W1, W2, W3, 1, 0);scalesoff
W5: imcombine(W1, W2, W3, 1, 1);scalesoff

W1 loads a color JPEG image.
W2 sets the image shading to TURBO.
W3 sets the image shading to PARULINE.
W4 stacks the 3 images into a single image.
W5 also stacks the 3 images into a single image, except the images are ordered top to bottom.
W1: readimage(gethome + "\data\kasha.jpg");scales(0)
W2: readimage(gethome + "\data\kashadog.jpg");scales(0)
W3: imcombine(w1, w2);scales(0)
W4: imcombine(w1, w2, 0, 0, black);scales(0)

W1 and W2 load two images of different sizes.
W3 combines the images horizontally. By default, the smaller image is padded with white pixels.
W4 is the same as W3, except the smaller image is padded with black pixels.
IMCOMBINE combines two or more images into a single image. If direction is 0, the images are combined side-by-side. If direction is 1, the images are stacked vertically.
When combining images of different dimensions, smaller images are padded with the specified background color bg.
All input images are converted to RGB if necessary.
IMCOMBINE is particularly useful for creating side-by-side or stacked image comparisons.