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.

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



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


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.


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


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