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) {
            document.body.appendChild(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) {
            document.body.appendChild(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) {
            document.body.appendChild(canvas);
        }
});

You can find the entire project online.

Javascript

References
  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

85 comments:

  1. Hello Michael

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

    Thomas

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

    ReplyDelete
    Replies
    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")

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

    ReplyDelete
  4. nike outlet store, http://www.nikeoutletstore.us/
    true religion outlet, http://www.truereligionoutletstore.us.com/
    stuart weitzman boots, http://www.stuartweitzmanoutlet.us/
    louis vuitton outlet, http://www.louisvuittonoutlet.in.net/
    polo ralph lauren, http://www.poloralphlauren.us.org/
    cheap snapbacks, http://www.cheapsnapbacks.us.com/
    the north face clearance, http://www.thenorthfaceclearances.us.com/
    true religion jeans, http://www.truereligionjeanscanada.com/
    jordan shoes, http://www.jordanshoes.us.com/
    cheap michael kors handbags, http://www.cheapmichaelkorshandbag.in.net/
    true religion jeans, http://www.truereligionjeansoutlets.us.com/
    rolex watches, http://www.rolexwatches.in.net/
    ralph lauren outlet, http://www.ralphlaurenoutlet.in.net/
    nike free uk, http://www.nikefreerunning.org.uk/
    michael kors factory outlet, http://www.michaelkorsfactoryoutletonline.com/
    oakley sunglasses, http://www.oakleysunglassesdiscount.us.com/
    gucci handbags, http://www.guccihandbags-outlet.co.uk/
    true religion jeans, http://www.truereligionjean.in.net/
    air jordan 11, http://www.airjordan11.net/
    dansko outlet, http://www.dansko-shoes.us/
    louis vuitton bags, http://www.louisvuittonbag.us.com/
    cheap mlb jerseys, http://www.cheapmlbjerseys.us.com/
    ed hardy clothing, http://www.edhardy.us.com/
    michael kors outlet, http://www.michaelkors-outlets.us.com/
    tiffany jewellery, http://www.tiffanyjewelleryoutlets.co.uk/
    michael kors handbags, http://www.michaelkorshandbag.co.uk/
    christian louboutin, http://www.scarpelouboutin.it/
    1007maoqiuyun

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

    ReplyDelete
  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

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












    vimax asli kayu stigi gold scott Home Design Ideas Plans

    ReplyDelete
  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.
    http://caramenggugurkankandungan.info/ cara menggugurkan kandungan

    ReplyDelete
  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

    penirum asli

    Titan Gel

    Vimax

    Hammer Of Thor

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

    ReplyDelete
  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

    ReplyDelete

  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

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

    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete
  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
    3)carton:5kg/carton,10kg/carton,20kg/carton..
    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.

    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete
  15. RAW AND RIPPENED ORGANIC PUERH TEA ON SALE
    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

    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete
  16. CAKE TEA SQUARE TEA BOWL SHAPE TEA PU-ERH ON SALE
    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.

    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete
  17. RAW AND RIPENED ORGANIC PUERH TEA ON ORDERS
    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.
    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete
  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. https://monktech.net/cash-app-customer-service-phone-number.html

    ReplyDelete
  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.
    website: www.apuertea.com
    email/skype: apuertea@hotmail.com
    whatsapp: +8615587209382

    ReplyDelete

  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

    ReplyDelete
  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.office.com/setup |WWW.WEBROOT.COM/SAFE

    ReplyDelete
  22. What a superb post! I have no words to describe this post because everthing is clear with your wonderfull words. I really feel out of world reading your post, it is full of fresh and usefull. I really appreciate, keep the work continue.

    norton.com/setup ! www.norton.com/setup ! office.com/setup


    ReplyDelete
  23. Right here is the right site for anyone who would like to find out about this topic. You know so much its almost tough to argue with you (not that I personally will need to…HaHa). You definitely put a new spin on a subject which has been written about for ages. Excellent stuff, just excellent!
    idea lottery winner

    ReplyDelete