[SOLVED] Color retention in RGB separate channel processing
Posted: 2016-05-29T15:37:52-07:00
I am having trouble recovering color data from a set of RGB images, following some complex processing. It's experimental at this stage to compare the results of individual channel processing and processing without separating the RGB channels.
I have four RGB images (16 bit .tiff) - b d f and l.
Processing involves separating b d f and l into their separate R G B gray channels;
convert l.tiff -separate l_%d.tiff (same for other images)
Then operating on each channel as follows - use R channel as an example, where p = processed .tiff extension is retained throughout - implied here.
lpR = (lR - dR) / (fR - bR)
For each channel this produces lpR lpG and lpB, which are then recombined into image lpRGB.
convert lpR.tiff lpG.tiff lpB.tiff -combine lpRGB.tiff
I am expecting a color image but the result is gray.
It is easy enough to use the -separate and then -combine operators on these images without the intervening processing and keep the color information, however, I think the processing is where the color information is lost.
I have tried using the -channel and -set colorspace operators, reading that in later versions of IM the -separate operator implies -channel RGBA and Sync?
How do I ensure that color is retained through the processing steps or is my initial usage when separating channels at fault?
I have four RGB images (16 bit .tiff) - b d f and l.
Processing involves separating b d f and l into their separate R G B gray channels;
convert l.tiff -separate l_%d.tiff (same for other images)
Then operating on each channel as follows - use R channel as an example, where p = processed .tiff extension is retained throughout - implied here.
lpR = (lR - dR) / (fR - bR)
For each channel this produces lpR lpG and lpB, which are then recombined into image lpRGB.
convert lpR.tiff lpG.tiff lpB.tiff -combine lpRGB.tiff
I am expecting a color image but the result is gray.
It is easy enough to use the -separate and then -combine operators on these images without the intervening processing and keep the color information, however, I think the processing is where the color information is lost.
I have tried using the -channel and -set colorspace operators, reading that in later versions of IM the -separate operator implies -channel RGBA and Sync?
How do I ensure that color is retained through the processing steps or is my initial usage when separating channels at fault?