CombineLayers - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

ImageTools

 CombineLayers
 combine layers into a color image

 Calling Sequence CombineLayers( img1, img2, img3, img4, opts )

Parameters

 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

Options

 • 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.

Description

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$

Create monochromatic images for the red, green, and blue layers.

 > $\mathrm{img_r}≔\mathrm{Create}\left(100,200,\left(r,c\right)→0.25\left(1+\mathrm{sin}\left(\left(0.005+0.003c\right)c\right)\right)\left(1+\mathrm{sin}\left(0.15r\right)\right)\right):$
 > $\mathrm{img_g}≔\mathrm{Create}\left(100,200,\left(r,c\right)→0.5\left(1+{ⅇ}^{-\frac{r}{50.}}\mathrm{sin}\left(\frac{c}{20.}\right)\right)\right):$
 > $\mathrm{img_b}≔\mathrm{Create}\left(100,200,\left(r,c\right)→\frac{r}{100.}\right):$

Combine them to create a color image.

 > $\mathrm{img_rgb}≔\mathrm{CombineLayers}\left(\mathrm{img_r},\mathrm{img_g},\mathrm{img_b}\right):$
 > $\mathrm{Embed}\left(\mathrm{img_rgb}\right)$