Color-Blindness Simulators

Demo images

Original Dog Vision Brightness
Original What a Dog Sees Brightness Only
No L (Red) Cones No M (Green) Cones No S (Blue) Cones
Protanopia
No L (Red)
Deuteranopia
No M (Green)
Tritanopia
No S (Blue)
L (Red) Cones Only M (Green) Cones Only S (Blue) Cones Only
L (Red) Only M (Green) Only S (Blue) Only

What they do

My color-blindness simulators are designed to simulate various sorts of human partial color vision, and also dog vision. They can also show the brightness information in normal color vision, and what each kind of cone "sees". They use linear filters that were fitted to the output of the Brettel-Vienot-Mollon simulation algorithm, which is used in the GIMP (an image editor) and in the Vischeck color-blindness simulator. After that fitting, they were tweaked to act more "proper", producing pure two-color output with grayscale mapping onto grayscale.

However, those and most other simulators cover only human color blindness, and do not attempt to simulate other species' vision, notably that of humanity's best animal friend, the dog. Dogs have red-green color blindness, seeing only long-wavelength (yellow) and short-wavelength (blue) color, and I model dog vision as an average of the two types of human red-green color blindness. Horses, another favorite species, also have red-green color blindness, though their vision is close to human no-red (protanopia) color blindness.

Dog vision and horse vision are typical of mammalian color vision; most mammalian vision is two-color (dichromacy), though some (pinnipeds and cetaceans) are completely color blind (monochromacy). Three-color vision (trichromacy) is present in only a few groups, notably the Old World simians (Old World monkeys, apes, and our species) and howler monkeys (Alouatta sp.). That capability emerged by the duplication of an opsin, a photoreceptor pigment; the human red- and green-sensitive opsins (visual pigments) still have close response curves. The genes for these opsins live on the X chromosome, which explains why red-green color blindness is much more common among men than among women; men have only one X chromosome and women two of them. However, the blue-sensitive one lives on chromosome 7, which both sexes have 2 copies of, and as a result, blue-yellow color blindness is much rarer and equally likely in both sexes.

Many birds and various other non-mammalian vertebrates do human vision one better, by being able to see in four colors (tetrachromacy); many birds can also see in the the near-ultraviolet. Looking even further afield, we find that honeybees and bumblebees can see yellow, blue, and near-ultraviolet, but not red. Bees and ants can even see light polarization, which they use for celestial navigation. Since most cameras are designed around human vision, they have color responses most convenient for human vision, they do not register ultraviolet as a separate color, and they do not pick up polarization, all of which makes it difficult to simulate bird and bee vision with available images.

What they are

I have created two color-blindness simulators:

The application was actually the first one that I'd created, because no commonly-used web browser had the necessary capabilities for the webpage until recently.

How to use the page

You will need at least Mozilla Firefox 3.5 or some equivalent to run it, because it works by using SVG filters on HTML objects.

Go to it here

For a page to simulate color blindness on, put its URL in the top text field, and then press "Go to URL". Be sure to enter the complete URL, or else the page will look for it on my site.

You can go to links in displayed pages as much as you want; the filters will automatically be applied to them. Though the page is displayed in an inlined frame (iframe), you may be able to step through the pages displayed there with your browser's forward and backward buttons

You can select which type of color blindness, how much partial color blindness, and what gamma correction factor to use. The type of color blindness should change immediately, but the others will not. Press "Go!" to make that happen.

This page was made possible by a feature of Firefox 3.5 described in Applying SVG effects to HTML content at Mozilla's developer center. SVG is Scalable Vector Graphics, an emerging vector-graphics standard for webpages.

How to use the application

You will need a recent version of Java installed to be able to use it.

Download the file here: CBSim.jar

To use is, issue this command in the directory that it resides in, with some appropriate modification if it resides elswhere:

java -jar CBSim.jar

You can specify image files on the command line, after the ".jar".

If this simulator starts running out of memory, you can start it with more memory by running it with something like

java -Xmx512M -jar CBSim.jar

where the "512M" means 512 megabytes (the default is 64 megabytes).

In MacOS X, you can also run it by double-clicking on it from the Finder, just like any other OSX program.

I have also included a source-code archive, complete with an OSX Xcode project file for it, so any programmers among you people can study how I did it.

When it is running, it will show either the command-line images or a demo image. Each window has menus

The ^ means command- (Macintosh) or ctrl- (Windows or Linux); ^V will also paste some text into the URL-request dialog box.

Each image window has a toolbar with a button for each View menu item from left to right. Left of each toolbar is a set of radio buttons for selecting colored or gray buttons. Unlike dog vision, there is no separate button or menu item for horse vision; use protanopia/no-red for that one.

If the image was created from a file or acquired from a URL, then the complete filename (file specification) or the complete URL will be shown above the buttons, and the window title will have only the filename proper, without the directory or site or protocol names.

The wait-time dialog box lets you set how long the program will wait before taking a screenshot; you can then bring to the front whatever you want to take a screenshot of. If you request that it wait more than 10 seconds, it will ask you if you really want to do that, just in case you accidentally set an absurdly large number.

To indicate what it is doing while it is hidden, it may beep as it waits and takes the screenshot. You can specify whether it is to beep as it waits, to beep only when it takes the screenshot, or not to beep at all.

The Extras dialog box lets you set two additional values:

For image-editor users

For the benefit of users of image editors like Adobe Photoshop, the Gimp, and OSX Pixelmator, I have created some channel-mixer filters in formats appropriate for each one.

Download the file here: ImageEditorFilters.zip

It has directories for each editor's format of filter. Load them into the editor with:

I have also included two command-line tools: CBSim.java (Java) and CBSim.py (Python). You compile the Java one with "javac CBSim.java" and run it with "java CBSim <args>". The command-line args are, in order:

input file, filter number, output file, filter number, output file, ...

The filters are numbered 1 thru 8, and are in the order given elsewhere in this document. The Python one requires the Python Imaging Library, which you can install either directly or with a package manager. It takes the same format of args as the Java one.

The brightness filter uses the CCIR 601 standard for the luminance (brightness) channel, and using the color-blindness-simulation data, I have estimated how each kind of cone responds to each color channel.

ChannelBrightnessL (Red)M (Grn)S (Blu)
Red0.2990.3410.1500.034
Green0.5870.5810.7220.115
Blue0.1140.0780.1270.852

References

Photoreceptor Response Peaks (wavelength in nanometers)

The author

Loren Petrich, petrich (at) panix (dot) com, and lpetrich at various online venues.