Colorblind Simulator

Introduction

This Page describes a Firefox extension that allows a user, and more importantly a developer, to simulate how a webpage might look for colorblind people. Colorblind afflictions can be divided into the following groups:

For more information consult this wikipage.

Installation

There is currently an experimental version of the extension. Install the extension by first installing the latest version of Firefox (see below). Next, either drag & drop the extension into the browser window or open it using File -> Open. After restarting the browser, installation is successful if three buttons appear in the statusbar.

Installing and updating Firefox 3.0

In order to install the development version of Firefox, you first need to get the latest nightly build, and then uncompress it into a directory of your choice. The most up to date build can always be obtained from here:

ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ Uncompress the file with commands similar to the following:

bunzip2 firefox-3.0a3pre.en-US.linux-i686.tar.bz2
tar -xvf firefox-3.0a3pre.en-US.linux-i686.tar 

To run your new version of firefox:

cd firefox
./firefox -P <profile>


Note: The -P command switch tells Firefox to create a profile directory. This will prevent your default profile from being overwritten. Please consult the Minefield Guidelines for additional information. You can insure that your Firefox is up to date by periodically selecting the check for updates option under the help menu.

Usage

The simulation algorithms can be run over the active browser document using the three new statusbar buttons. Here you see the Ishihara test before and after the simulation:
Simulation.jpg
I've reworked the GUI you can now start simulation over the webdeveloper extension, as you can see in the next image.
webdevGUI.png
If you want a button instead in your (Navigation)-Toolbar, without using the webdeveloper extension click View->Toolbars->Customize and Drag&Drop the ColorSimulation Button to your Toolbar.
GUI1.png
Using the Button is very easy look at the next image
GUI2.png

Settings


options.jpg

Architecture

  1. We have a XPCOM component (called AlgorithmDichromatSimulation) written in C++ that computes the simulation colors. A simulation color shows a normal observer how that color looks for a colorblind observer. You pass one color into this component and get one simulation color back.

  2. We also have another component, were you can pass an array of colors into it, and you get an array with simulation colors back. This component (called ImageProcessor) uses also the first component. The "in array" is usually a part of an Imagedata.data array that you use with CanvasRenderingContext2D.getImageData() and putImageData().
    You may ask why this is not part of the first component. Maybe someday putImageData()/getImageDate()/toDataURL() are useable from C++ and not only from javascript. Then I will put this stuff from the javascript code to this component.

  3. Then we have an algorithm (written in js) that goes through the document (HTML Doc, Stylessheets and later SVG or other XML stuff). Whenever the algorithm finds color information, it calls the AlgorithmDichromatSimulation component which computes a replacement color and puts it into the document tree.
    If this algorithm finds an <img> tag it does the following:

    1. Draw <img> to a <canvas> element (which is invisible)

    2. Get (getImageData()) every pixel from the <canvas> (in 50x50px blocks)

    3. Pass this 50x50px array into the ImageProcessor component

    4. Put (putImageData()) the array back on the <canvas>

    5. Convert <canvas> to a data URL by calling toDataURL()

    6. Replace <img src="URI" with src="dataURL:"

Development

Beta testing

I release the first beta of this Extension when it's ready for testing. I think first august week is realistic.

Questions

If you have any question, ask them in this section. Please set a prefix in front of you question like "gz:"

Bugs

(Priority P1 > P2 > P3 and Enhancement)

[Status] [Priority] description

GAP/ColorBlind (last edited 2008-02-03 14:47:26 by localhost)