Wednesday, May 12, 2010

Color Vision with Pixel Bender

Pixel Bender is a powerful tool for image processing released by Adobe Systems as part of their CS4 product line — it's integrated into After Effects, Flash, and Photoshop.  It's a fun, and straight-forward language to program with.

The Color Vision library for Pixel Bender is composed of two parts; a color vision daltonization kernel [1, 2] and simulation kernel [3, 4, 5].  These algorithms combined enable developers to target specific forms of color blindness from both sides of the spectrum.

These kernels have multiple uses, one that interests me the most is plugging them into popular video hosting websites such as Hulu, Vimeo and Youtube.  The daltonization kernel, based on the LMS daltonize algorithm, could expose 5% of the population with dichromatic vision to details they would have otherwise missed.  The simulation kernel, targeting the other 95% of the population, can be used to see what motion pictures look like through the eyes of the color blind.

Photoshop installation
  1. Install Photoshop's Pixel Bender plug-in (it's not built unless you're on CS5).  You can find this plug-in at the Pixel Bender Technology Center.  
  2. Put the Pixel Bender .pbk filters you wish to install (see Pixel Bender kernels) into the ~/Adobe Photoshop CS4/Pixel Bender Files/ directory on your computer.  
  3. Open the "Filter" menu from within Photoshop and click on "Pixel Bender Gallery".
After Effects installation
  1. Put the Pixel Bender .pbk filters you wish to install (see Pixel Bender kernels) into the ~/After Effects CS4/Plug-ins/Effects/ directory on your computer.  
  2. Open the "Effects" menu from within After Effects
Flash Player embedding
The code to import Pixel Bender kernels into Flash Player can be found in Main.as, Daltonize.as and Simulate.as.  The kernels must be compiled into .PBJ, which you can find in the parent directory.

Developers
If you're interested in messing around with the code behind these filters, download the Pixel Bender Toolkit to load the Pixel Bender .pbk filters included in this article.  Another great place to start is the Pixel Bender's Developer Guide.

Pixel Bender kernels

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

No comments:

Post a Comment