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.
CImage = CImageSet:RgbMerge( CImageSet ) where |
CImageSet is a CImageSet object that contains the R, G, and B channel images (the order R, G, B is important).
CImage is a new CImage that contains a color image. On failure, nil is returned.
Suppose that 3 CImage objects exist with names R,G, and B and have the same dimensions (the DimEq method can be used to test this before merging). The following script merges these images into an RGB image:
|
-- create an image set to hold the images |
|
-- add channel images to the image set |
|
|
|
|
|
-- create a CImCombine object |
|
-- merge the channels and return a new CImage |
|
-- delete S if no longer needed |
|
-- delete C if no longer needed |