dinasset wrote:
Thanks RobA!!! Quick and excellent work!
I downloaded and tried it; but now, I have a doubt on understanding how to detect C, M, Y values; let me explain:
my idea was that I had to sum up G+B to get the Cyan value, R+B to get the Magenta value, G+R to get the Yellow value; so I did in my (very slow...) python, then by comparing the so calculated C, M, Y values I selected the biggest value, then applied the corresponding full C (0,255,255), M(255,0,255), Y(255,255,0) value to that pixel.
The results are significantly divergent.
Am I totally wrong?
Yes. You are totally wrong
C <> G+B
M <> R+B
Y <> G+R
The two colour spaces are not at all related that way.
Really, they C = 1-1/R, M = 1-1/G, and Y = 1-1/B working in the 0..1 range for all values.
Also, reading the maxRGB documentation,
Quote:
For every pixel, the filter keeps intensity of the RGB color channel which has the maximal intensity and reduces other both to zero. For example: 220, 158, 175 max--> 220, 0, 0. If two channels have same intensity, both are held: 210, 54, 210 max--> 210, 0, 210.
So it doesn't set it to the full R,G, or B value (255), instead it just zeros out the not highest channel values at that pixel.
And thinking about this points out that my script was actually a waste of time, as the same results can be done by inverting the image, (Colours->Invert) followed by he maxRGB plugin, then invert the colours again....
Though I could extend the script to work across any of the colourspaces via a selector... HSL, HSV, YUL, LAB, etc...
-Rob A>