Monday, May 10, 2010

LMS Daltonization Algorithm

  1. Matlab code from Analysis of Color Blindness
  2. Python code from AccessibleMoin
  3. Javascript code from
  4. PixelBender code from
Composed of four primary steps:
  1. Conversion of RGB coordinates into LMS, a color space suitable for calculating color blindness as it's represented by the three types of cones of the human eye, named after their sensitivity at wavelengths; Long (564–580nm), Medium (534–545nm) and Short (420–440nm). 

  2. Simulation of color blindness by reducing the colors along a dichromatic confusion line, the line parallel to the axis of the missing photoreceptor, to a single color.

  3. Compensation for color blindness by shifting wavelengths away from the portion of the spectrum invisible to the dichromat, towards the visible portion.

  4. Conversion of LMS coordinates back into RGB using the inverse of the RGB->LMS matrix.
LMS daltonization evolution:
  1. Analysis of Color Blindness
    Describes how to compensate for color-blindness by calculating the difference of the simulation, and then applying an error modification matrix.

  2. Intelligent modification for the daltonization process of digitized paintings
    Describes how to improve the error modification matrix by modifying it to be adaptive to each image; increasing CPU usage and providing better results.

  3. Intelligent Modification of Colors in Digitized Paintings for Enhancing the Visual Perception of Color-blind Viewers
    Optimizes the previous, reducing computational time through the use of color quantization, and caching.


  1. I dowloaded Chrome Daltonize - at least that is what my MAC window said.
    But I can't find it in my MAC
    I have Snow Leopard.
    Can you help?
    Is there a manual ?

  2. Head over to the Chrome Extensions library, or click on this link:

    From there, click on the "Install!" button :)

    1. Hi Michael,

      I am graduate student at UMBC. Currently I am
      working on developing an application to assist
      color blind people in browsing web content. For
      re-coloring I need your daltonize LUTs. Can you
      please provide me those downloadable LUTs?

      Thank you

  3. Is there a MATLAB code for the proposed algorithm in the paper 'Intelligent modification for the daltonization process of digitized paintings'?
    And how do we prove that its a better one?

    1. Great questions, I'd like to know this as well :)

  4. Is anyone having issues with the Tritanope portion of this method? The simulated (not daltonized) tritanope images reveal LOTS of blue, which is exactly the opposite of the nature of the deficiency. Any one else having this problem?

    1. Hello. In case you are still interested... the tritanope transformation matrix is wrong! the Viénot-Brettel-Mollon algorithm must be applied with red instead of blue, the colours must lie in the KRWC plane. I get St = -0.012245*L + 0.072035*M.

    2. Hi Daniel kindly can you please explain better how this algorithm works for tritanope? Thanks very much.

  5. Hei,

    I was reading your code, and I assume that the simulation is based on the formulas proposed by Viénot and Brettel in "Digital Video Colourmaps for Checking the Legibility of Displays by Dichromats". I implemented your code and tested it on the images show in the paper, however, I did get quite different results.

    I can see a problem right in the beginning of the code, when you open the image, and convert it directly from RGB to LMS. Which RGB space is chosen in that case?

    Most image files are coded in sRGB space, which is a non-linear color space. LMS, however is a linear color space. Thus, conversion from non-linear sRGB space to LMS-space is not possible via a simple 3x3 matrix.

    The correction for that problem would be a preceeding step in which you convert the image from non-linear sRGB to linear RGB first. Then, you can apply the linear 3x3 matrix.

    The same problem occurs in the end, when you convert from LMS to RGB without taking into account linearization of sRGB color space.



  6. nike outlet store,
    true religion outlet,
    stuart weitzman boots,
    louis vuitton outlet,
    polo ralph lauren,
    cheap snapbacks,
    the north face clearance,
    true religion jeans,
    jordan shoes,
    cheap michael kors handbags,
    true religion jeans,
    rolex watches,
    ralph lauren outlet,
    nike free uk,
    michael kors factory outlet,
    oakley sunglasses,
    gucci handbags,
    true religion jeans,
    air jordan 11,
    dansko outlet,
    louis vuitton bags,
    cheap mlb jerseys,
    ed hardy clothing,
    michael kors outlet,
    tiffany jewellery,
    michael kors handbags,
    christian louboutin,

  7. This comment has been removed by the author.

  8. The matlab link no longer works - is there any way for that to be restored?