2 ms·
This expression should work to get all the reds without having to do colourspace transform (standard unsigned 8-bit RGB expanded to signed ints of greater width
by userbinator 10y ago
This expression should work to get all the reds without having to do colourspace transform (standard unsigned 8-bit RGB expanded to signed ints of greater width):
r - g > 128 && r - b > 128
The constants can be adjusted to change the definition of what you consider red. (Based on https://en.wikipedia.org/wiki/File:HSV-RGB-comparison.svg https://en.wikipedia.org/wiki/File:HSV-RGB-comparison.svg )
- lettergram 10y agoIt doesn't properly handle the light, i.e. if the r or g channel is super dim it'll cause issues.