Wednesday, May 12, 2010

Color Vision with Javascript

The Color Vision library for Javascript is composed of two parts; a color vision daltonize.js [1, 2] and simulate.js [3, 4, 5].  These algorithms combined enable developers to target specific forms of color blindness from both sides of the spectrum.

The following code is an example of using the Color Vision library to daltonize an image, exposing details to a protanope:

Color.Vision.Daltonize(image, {
        type: "Protanope,
        callback: function(canvas) {

Here are the results on an Ishihara test plate [6].

Color Blindness Simulation 

Gary W. Meyer and Donald P. Greenberg [3] present an algorithm to simulate the world through the eyes of dichromats.  In this example, we simulate how a protanopic (red-cone missing) individual would perceive and image:

Color.Vision.Simulate(image, {
        type: "Protanope",
        amount: 1.0,
        callback: function(canvas) {

One interesting thing about this algorithm is that it can be modified to match other forms of color blindness by modulating the confusion line coordinates.  At this time, there is no online color vision tests that can provide measurements of an individuals confusion line, as such, one is left to creating fanciful psychedelic customalies:

Color.Vision.Simulate(image, {
        type: "Custom",
        x: 0.7465,
        y: 0.2535,
        m: 1.273463,
        yint: -0.073894,
        amount: 1.0,
        callback: function(canvas) {

You can find the entire project online.


  1. Françoise Viénot, Hans Brettel and John D. Mollon
    Digital video colourmaps for checking the legibility of displays by dichromats
    Color Research and Application, 24(4): 243-252
    , 1999.

  2. Onur Fidaner, Poliang Lin and Nevran Ozguven.
    Analysis of Color Blindness

  3. Gary W. Meyer and Donald P. Greenberg
    Color-Defective Vision and Computer Graphics Displays
    IEEE Computer Graphics and Applications, 8(5): 28-40, 1988.

  4. Vivianne C. Smith and Joel Pokorny
    Spectral sensitivity of the foveal cone photopigments between 400 and 500 nm
    Vision Research, 15(2): 161-171, 1975.
  5. Bruce Lindbloom
    RGB Working Space Information

  6. Les Daltoniens
    Le test d’Ishihara


  1. Hello Michael

    Nice work. Under which licence did you publish daltonize.js?


  2. The links to the javascript files seems to be broken.

    1. Many years later, but to use this there needs to be an additional quote after the final e and before the comma on the line:
      type: "Protanope",

      Also "image" should be the image object. I just used document.getElementById("myImageID")

  3. Hi Michael,

    First of all thanks for your awesome work....Secondly, I want to highlight those pixels in the image (may be replace the colors of those pixels into black spots), which represents the most confused colors of the whole image. These confused colors can be of many different intensities.

    I am trying to understand the algorithm i.e. Daltonize and Simulate, but I am unable to figure out, "How can I say, during the scan of image pixel by pixel, whether to highlight this pixel or not on the basis of most confused color information".

    Please give me some guidance about it. I will be thankful to you.

  4. 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,

  5. I appreciate the so-date information on your part.
    foro de opciones binarias

  6. This blog is so nice to me. I will continue to come here again and again. Visit my link as well. Good luck
    obat aborsi
    cara menggugurkan kandungan

  7. Truly very important information that can provide a bright spot for reference sources

    vimax asli kayu stigi gold scott Home Design Ideas Plans

  8. I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts. cara menggugurkan kandungan

  9. Greetings admin
    I like your topic, after reading your article very helpful at all and can be a source of reference
    I will wait for your next article updates
    Thank you, for sharing


    penirum asli

    Titan Gel


    Hammer Of Thor

  10. Michael Kors Handbags On Sale,
    You can find Michael Kors handbags in many department stores around the country.
    Michael Kors Purses Outlet,
    They are being seen all over the place.
    Michael Kors Bags On Sale,
    There are so many fabulous handbags to fall in love with.
    MK Handbags,
    To find these amazing handbags you can also shop online for all your Michael Kors products.

  11. This article is interesting and useful. Thank you for sharing. And let me share an article about health that God willing will be very useful. Thank you :)

    Khasiat Daun Sirsak untuk Benjolan
    Obat Telinga Bernanah paling Ampuh
    Cara Menghilangkan Benjolan di Miss V


  12. The article is very interesting. And I also want to share articles about health, I'm sure this will be useful. Read and share it. Thank you very much :)

    Obat Mujarab untuk Penyakit Epilepsi
    Cara Mengobati Penyakit Mata Ikan
    Pengobatan Kanker Kolon (usus besar)
    Pengobatan Epilepsi secara Tradisional

  13. A Pu’er Bulang highmountain tea garden co.,ltd. located in the southwestern of Yunnan province: Zhengwan village, Nanping town, pu’er city, which is commended as “Tea- city of China”,” The origin of the tea world” and ”The capital of pu’er”. This is such a place where the Dai people populated in with quite rich tea culture. The average elevation of it is about 1300 meters and Asian Corridor in Heaven had crosses the whole land of it.
    We have self-owned organic tea garden of 166 hectares which were reclaimed from secondary forest in1998, there were no any planting history but clear and fertile land.
    We insist in rigid organic planting and management since reclaimed without any of chemical pesticides and fertilizers.
    We are constructing our new organic factories(Covers an area of 32000 Square meters with value of 98000000 RMB) and bring in new machines according to food production standard regulation for organic tea processing to achieve the perfect combination of modern processing management with traditional technology.
    Our tea garden and products continuously obtained China, EU, NOP and JAS organic certification since 2010. The products have been exported to Europe and United States for many years.
    There are three characteristics of Zuxiang organic tea: mellow and exquisite taste, obviously sweet aftertaste, and various types of aroma, thanks to the elaborately processing way of organic fresh leaves, which is a combination of traditional manual methods with modern technology and machines.

    whatsapp: +8615587209382

  14. 1)paper box:25g/box,62.5g/box,100g/box,125g/box,250g/box,500g/box,1000g/box..
    2)color plastic bag:25g/color plastic ba,100g/color plastic bag,250g/plastic bag,500g/plastic bag,1000g/plastic bag
    4)wooden case:1kg/wooden case,2kg/wooden case,5kg/wooden case,10kg/wooden case,20kg/wooden case,35-40kg/wooden case
    5)weave bag: 30kg/weave bag.
    6)gunny bag: 30kg/weave bag.

    whatsapp: +8615587209382

    Gold, pink-colored exquisite box, good for gift and personal use
    Vacuum packing isolates the tea leaves from air, and preserves the freshness of the tea leaves
    1. 24 Hours Hot-line & Email services
    2. Your questions about our products or prices will be answered in 24 hours
    3. Noticing the delivery time timely
    4. Offering OEM/ODM service

    whatsapp: +8615587209382

    The effect of pu'er tea: It has the pharmacological effects of refreshing and clearing the

    heart, clearing away heat and relieving heat, eliminating phlegm, eliminating greasy weight

    loss, clearing heart and removing trouble, detoxifying and waking up, quenching thirst,

    reducing fire and eyesight, stopping phlegm and dehumidification, and also on modern

    diseases such as radiation. And cardiovascular and cancer and cancer, have certain

    pharmacological effects.

    whatsapp: +8615587209382

    Our Organic Dragon well/Long Jing green tea is organic, growing in the seaside high mountain located on Peach Island in Zhoushan city, Zhejiang, which is certificated by Germany Kiwa BCS Oeko-Garantie GmbH

    With the good environment, our tea gets a special high flavor and good taste. It is known for "four uniques": bright green color, sweet scent, full-bodied flavor, elegant shape. The flat and even appearance shows emerald color, bright and yellow-green water color, fresh aroma, mellow and sweetish taste.
    whatsapp: +8615587209382

  18. If users want to know all common hitches, then they don’t need to wander anywhere rather just picking their cell phone and giving a quick call at our toll-free Cash App Customer Service +1-844-659-2999 number. Here, we have ultimate and dedicated team of technical professionals who are available 24 hours a day to deliver you with the best aid.

  19. Like all true tea, black tea and pu'er tea offers many potential health benefits. Research has found that tea (Camellia sinensis) can have many positive effects on human health, including improved cardiovascular function, cancer risk reduction, improved immune function, improved oral health, and help with weight management.
    whatsapp: +8615587209382


  20. Dell customer support service phone number 1800-382-3046 can be accessed anytime and the Dell printer support experts are always available 365*24*7. By dialing the toll-free phone number.The Dell printer support is available 24/7, and one can reach out to the experts for error resolutions. Just dial dell customer service number 1800-382-3046.
    Dell Printer Support Number

  21. I visit your web page. It is really useful and easy to understand. Hope everyone get benefit. Thanks for sharing your Knowledge and experience with us. |WWW.WEBROOT.COM/SAFE