Hacker News new | past | comments | ask | show | jobs | submit login

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 )



It doesn't properly handle the light, i.e. if the r or g channel is super dim it'll cause issues.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: