CombineChannels
Produces a colour pixmap by using same-size greyscale pixmaps as RGB or HSV channels.
Syntax
-
CombineChannels(fam, ch1, ch2, ch3)
-
fam
is one of"rgb"
or"hsv"
-
ch1
,ch2
, andch3
are greyscale pixmaps of the same size
-
Description
If ch1
, ch2
, and ch3
are greyscale pixmaps of the same size, then CombineChannels(fam, ch1, ch2, ch3)
returns the colour pixmap that has ch1
, ch2
, and ch3
as its RGB (if fam = "rgb"
) or HSV (if fam = "hsv"
) channels. The greyscale intensities, from black to white, are mapped linearly to [0, 360]
for hue and to [0, 1]
for all other channels.
Examples
harvestman ≔ ExtractChannel(ExampleData("harvestman"), "rgb", "r");
rabbit ≔ ExtractChannel(ExampleData("rabbit"), "rgb", "g");
CombineChannels("rgb", harvestman, rabbit, harvestman)
harvestman ≔ ExtractChannel(ExampleData("harvestman"), "hsv", "v")
rabbit ≔ ExtractChannel(ExampleData("rabbit"), "hsv", "v")
CombineChannels("hsv", harvestman, rabbit, rabbit)