Description Usage Arguments Details References

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

1 |

`my_brick` |
Object of class RasterBrick or RasterStack from the raster package |

`method` |
Method of converting RGB to greyscale |

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.

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.