rgb2grey: Convert RGB to greyscale using 'average' or 'gleam' methods

Description Usage Arguments Details References

Description

Convert RGB to greyscale using 'average' or 'gleam' methods

Usage

1
rgb2grey(my_brick, method = c("ave", "gleam"))

Arguments

my_brick

Object of class RasterBrick or RasterStack from the raster package

method

Method of converting RGB to greyscale

Details

For the 'gleam' method we assume that the RGB image has been gamma-compressed. We then: 1. Gamma expand it based on the formula at the wikipedia link below 2. Calculate the arithmetic mean across the gamma-expanded channels 3. Rescale to 0:255

See PLoS One article referenced below.

References

https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0029740


treysp/coolit documentation built on June 5, 2019, 5:16 p.m.