rgb2gray.luminosity: Convert a RGB Color to Gray Scale using Luminosity Weights

Description Usage Arguments Value

Description

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).

Usage

1

Arguments

r

the red value

g

the green value

b

the blue value

Value

the gray scale value.


thomasWeise/plotteR documentation built on May 29, 2019, 5:41 a.m.