Last active
March 10, 2019 12:16
-
-
Save ezhov-da/fc0f7a1f248aea31176fbdea7a636e1a to your computer and use it in GitHub Desktop.
convert rgb to grayscale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//convert rgb to grayscale (0 to 1) where colors are on a scale of 0 to 255 | |
double gray = (0. 2126 * red + 0. 7152 * green + 0. 0722 * blue) / 255. 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment