ImageTools
CombineLayers
combine layers into a color image
Calling Sequence
Parameters
Options
Description
Examples
CombineLayers( img1, img2, img3, img4, opts )
img1
-
GrayImage; first image layer
img2
GrayImage; second image layer
img3
GrayImage; third image layer
img4
(optional) GrayImage; fourth image layer
opts
(optional) equation(s) of the form option = value; specify options for the CombineLayers command
output = Image
Specifies a data structure into which the output is written. This can be used to avoid allocating memory. The size and number of layers must match that of the input. The dimensions of the output image are adjusted so that the row and column indices match the input. The default is NULL.
The CombineLayers command combines monochromatic images to create a colored image.
The img1, img2, img3, and img4 parameters specify the input image layers. They must have the same dimensions and be of type GrayImage.
If the optional parameter img4 is not given, the result is an image of type ColorImage. If img4 is given, it corresponds to the alpha layer and the result is an image of type ColorAImage.
with⁡ImageTools:
Create monochromatic images for the red, green, and blue layers.
img_r≔Create⁡100,200,r,c↦0.25⋅1+sin⁡0.005+0.003⋅c⋅c⋅1+sin⁡0.15⋅r:
img_g≔Create⁡100,200,r,c↦0.5⋅1+exp⁡−0.02000000000⋅r⋅sin⁡0.05000000000⋅c:
img_b≔Create⁡100,200,r,c↦r100.:
Combine them to create a color image.
img_rgb≔CombineLayers⁡img_r,img_g,img_b:
Embed⁡img_rgb
See Also
ImageTools[GetLayer]
ImageTools[Layers]
ImageTools[SetLayer]
Download Help Document