You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the conversion to grayscale is using the formula:
Uint8 grayedColor=(rr+gg+bb)/3
This is wrong. When converting to grayscale, perceptual weighing must be applied (for example the eye is much less sensitive to blue than to green, so blue appears much darker when converted to grayscale). The most common formula used is that specified in CCIR 601, which is approximately:
OMG, never even thought about colors that way before. I will do some changes to see how better it looks now. Also, does the current method apply as a different graphic effect/shader or should I just get rid of it?
No harm leaving it as an option, I guess, but I can't think of any uses for it other than to provide compatibility with earlier versions of your software.
Currently the conversion to grayscale is using the formula:
Uint8 grayedColor=(rr+gg+bb)/3
This is wrong. When converting to grayscale, perceptual weighing must be applied (for example the eye is much less sensitive to blue than to green, so blue appears much darker when converted to grayscale). The most common formula used is that specified in CCIR 601, which is approximately:
0.30 * rr + 0.59 * gg + 0.11 * bb
or if you prefer to do it all in integers:
(30 * rr + 59 * gg + 11 * bb) / 100
There is much more detail available at Stack Overflow.
The text was updated successfully, but these errors were encountered: