Arnaud_N
(Arnaud N)
January 7, 2024, 10:03am
1
Hi,

The Colorness function is documented here: Monkeybread Xojo plugin - Picture methods

There’s no mention of the minimum and maximum values of the parameter. All I can see is it’s not a double from 0 to 1, since the parameter defaults to 10.

Please, can you tell me these values?

So the function loops over all pixels in a picture.

calculates how much they are away from gray levels.

e.g. red is 200, green is 200 and blue is 200 → gray pixel. But red is 200, green is 0 and blue is 0 → value is 200 for the difference.

And that is bigger than the threshold, so it is counted.

Result is colored pixel count divided by total pixel count.

Arnaud_N
(Arnaud N)
January 7, 2024, 10:48am
3
Ah, I see. Threshold is simply the computed difference. Thank you.

If, say, red is 50, green is 100 and blue is 200, is the source value the middle one?

100-50 → 50
200-100 → 100

so this is a colored pixel as either of the differences is >threshold.

Arnaud_N
(Arnaud N)
January 7, 2024, 4:06pm
5
Yes, of course. I was rather asking what is the formula for the return value.