ColorBlindess: Processing Library

Introduction

I built a Processing library that can simulate color blindness on any Processing sketch, approximating what a color blind person would see.

My goals for this library are:

  1. Easy to use tools for simulating color blindness. This will allow artists and creative coders to consider the needs of color blind individuals in their designs. The implementation is FAST and will not significantly slow down the frame rate of a sketch.

  2. Interactive and educational visualizations for understanding color blindness.

An example of something you can make with this is below. Most people see semi-random colored squares.

A Protanope (red-green color blind person) would see something similar to below, recognizing the pattern as Conway's Game of Life:

My hope is for this library to help educate the Processing community about color blindness and to create new opportunities for artistic expression.

Features

ColorBlindness works with Processing 3.x.

To learn how to use ColorBlindness, start with the ColorBlindness Tutorial. Next, have a look at the examples provided to you when you installed ColorBlindness through Processing's Import Library feature.

ColorBlindness comes with two algorithms: One is for Color Blindness Simulation, and the other is for Daltonization. Each works by allowing the normal Processing functionality to render each frame of the animation. The library essentially does a post-processing transformation to each frame, altering the colors in a specific way.

For both of these algorithms (or generators) you can accept the default settings or configure them as you please. You can also make your own custom generators. Debug functionality is built into ColorBlindness to support your development efforts.

The examples illustrate everything mentioned above as well as provide utility programs to help you explore the library's potential.

I have documented the math and calculations supporting my library if you want to learn about the Color Science behind how this works.

Javadocs are available if you need them. You can find the source and latest release on github.

Limitations

Color blindness simulations rely on color appearance models and theories that are imperfect. No simulation will be able to perfectly recreate what a color blind person sees. Colors that the library says should be identical to a color blind person may actually have small changes in hue or brightness.

The success of the color blindness simulation depends on the color reproduction of the monitor or projector displaying the Processing sketch. If the color balance settings are off, the results will be flawed. Viewing angle and room lighting can also alter the results.

I did research color blindness and can cite sources and explain the math behind my library's calculations. Nevertheless, I am not color blind so it is impossible for me to test this in a way that is completely satisfying to me. The best I can do is look at the implementations of many other color blindness simulation tools and compare results. My conclusion is that my library works at least as well as the other tools out there, but I don't believe it is perfect.

History

The ColorBlindness library is a stripped down fork of my Camera-3D library. I realized that in addition to 3D effects, I could implement color blindness simulation with Camera-3D's generator framework. It would work, but most likely nobody would ever know about it or guess that a 3D library could do something like that. Since I thought that simulating color blindness would be a useful Processing feature, I decided to make a new library instead.

Acknowledgements

I would like to thank the supportive campers at ITP Camp, especially the folks who attended the session I taught using a prototype version of the ColorBlindness library. I would also like to thank Alex Wagner and Jake Voytko. As I am not color blind, I am grateful for their much needed assistance and feedback on what my Processing sketches look like.

Future Features

In the future I would like to port this library to p5. Below is a working proof of concept, demonstrating that it is possible to simulate colorblindness in a real-time animation with p5. The upper half of the sketch is simulating color blindness with a frame rate (on my machine) of 60 frames per second. Web tools made in p5 could reach a wider audience and educate more people about the realities of color blindness. The p5 library will be just as easy to use as the Processing library with all the same features.

I am interested in learning more about Color Science. It is a subject that is endlessly fascinating to me. I put a lot of effort into building tools that are well thought out but I know there are scientists who know much more about this than I do. As I learn more I will extend the library's capabilities. If you have suggestions for how to improve this, please let me know.