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

Description Usage Arguments Value

View source: R/rgb_to_gray.R

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
aitoa.rgb2gray(color, limit = 255L, make.int = (limit > 1L))

Arguments

color

the r-g-b vector

limit

the color limit

make.int

should we convert the result to an integer?

Value

the scalar gray scale value.


thomasWeise/aitoaEvaluate documentation built on Dec. 6, 2020, 1:22 p.m.