Skip navigation.

A Tale of Two Page HitsAll recent postsThe American Flag As Seen By People with Color Blindness

Color Blindness Simulator Revamped

It’s been a while since I touched my online color blindness simulator (read this post from 2005 for an overview of types of color blindness my tool supports and the algorithms behind it). Unfortunately, an elusive bug lurked in the calculations: once in a blue moon the tool would throw an exception on an integer overflow. I could never reproduce it or find the flaw in calculations.

Two readers of my blog asked to share the simulator as a stand-alone component. This prompted me to hunt down a more correct algorithm which is actually used in GIMP.

As an added benefit, the color blindness module I ported from GIMP also handles tritanopia (inability to discern blue and yellow). While at it, I heavily refactored my old, procedural code and extracted the simulator into a component of it own, as my readers requested. Feel free to grab the source code here.

Take a look at the output of two sample simulations of Toyota Matrix and Denver Airport produced by the new tool:

Color blindness sumilation of Toyota Matrix

Color blindness simulation of the Denver Airport

Looking forward to your feedback!

Comments

Comment permalink 1 Hal Dell |
Can't get to the link for source code here on this page?
Comment permalink 2 Milan Negovan |
Hal, the link works. Does it cause trouble on your end?

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):