Description Usage Arguments Value
We apply the simple algorithm from
http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/
to convert rgb values to gray-scale based on luminosity. Notice that this
function does not care about the range of r
, g
, and b
:
If all of them are in 0..255
, then the output will also be in
[0,255]
(though not necessary integer). If they are in [0,1]
,
the output is also in [0,1]
. As coefficients, we use the values for
BT.709 (http://en.wikipedia.org/wiki/Rec._709).
1 | rgb2gray.luminosity(r, g, b)
|
r |
the red value |
g |
the green value |
b |
the blue value |
the gray scale value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.