CImCombine:RgbMerge


The RgbMerge method creates a new RGB color image by merging R, G, and B channel images from the first 3 members of a CImageSet. Since all 3 images must have the same column and row dimensions, you may wish to use the DimEq method to test them before merging.

Syntax

CImage = CImCombine:RgbMerge( CImageSet )

bullet.gif    CImageSet contains images for the R, G, and B channels, with the R image at index 1, G at index 2, and B at index 3.

bullet.gif    On success, this method returns the merged RGB image as a new CImage.

bullet.gif    On failure, this method returns nil.

Example

Suppose that 3 CImage objects exist with names R, G, andB. The following script creates a CImageSet and then merges these images into an RGB image:

S = new_imageset()

-- create an image set to hold the images

S:Append(R)

-- add R channel image to the image set at index 1

S:Append(G)

-- add G channel image to the image set at index 2

S:Append(B)

-- add B channel image to the image set at index 3

C = new_imcombine()

-- create a CImCombine object

I = C:RgbMerge( S )

-- merge the channels and return the new RGB CImage

S:delete()

-- delete S if no longer needed

C:delete()

-- delete C if no longer needed

Related Topics

CImCombine class, CImageSet, ExtractChan

 


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.