multicolorfits.simulate_colorblindness#

multicolorfits.simulate_colorblindness(rgb, kind='deuteranopia')[source]#

Simulate how an RGB composite appears with a color vision deficiency, to help pick layer colors that stay distinguishable for all viewers.

Uses the Machado et al. (2009) severity-1.0 transformation matrices in linear RGB space.

Parameters:
  • rgb (array) – RGB image (…,3) with values in [0,1]

  • kind (str) – ‘protanopia’, ‘deuteranopia’ (default, the most common), or ‘tritanopia’. Short forms ‘protan’/’deutan’/’tritan’ also accepted.

Returns:

array – Simulated RGB image, same shape, values in [0,1]