Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cvd_image

Convert Colors of an Image


Description

Used in cvd_emulator. Takes an image object and converts the colors using deutan, protan, tritan, desaturate functions. The image will be written to disc as a PNG file.

Usage

cvd_image(img, type, file, severity = 1)

Arguments

img

array as returned by readPNG and readJPEG of size height x width x depth. The depth coordinate contains R/G/B and alpha if given (png).

type

string name of the function which will be used to convert the colors (deutan, protan, tritan, desaturate). If set to original the image will be written as is.

file

string with (full) path to resulting image. Has to be a png image name.

severity

numeric. Severity of the color vision defect, a number between 0 and 1.


colorspace

A Toolbox for Manipulating and Assessing Colors and Palettes

v2.0-1
BSD_3_clause + file LICENSE
Authors
Ross Ihaka [aut], Paul Murrell [aut] (<https://orcid.org/0000-0002-3224-8858>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), Jason C. Fisher [aut] (<https://orcid.org/0000-0001-9032-8912>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>), Claus O. Wilke [aut] (<https://orcid.org/0000-0002-7470-9261>), Claire D. McWhite [aut] (<https://orcid.org/0000-0001-7346-3047>), Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>)
Initial release
2021-05-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.