## Recommended Posts

Toji    535
Just wondering if anyone here can point me in the right direction. I'm looking for an algorithm(that can be implemented in a shader) that will process an image so that it is easier for a colorblind person to make out differences in their problem colors. A couple of nights worth of Googling hasn't given me much except examples of pictures that have been run through the process. Conversely, I'd also be interested in a process to simulate the various forms of color blindness, which certainly seems more popular. Thanks for any tips! (And yes, to answer the obvious question, I am colorblind. Red/Green Deficient, to be exact)

##### Share on other sites
sirGustav    588
How do you expect it to work?
switch the channels? out.rgb = in.bgr
replace with another color? redish => magentaish

..or it might be easier to skip the colors altogether. Make the game playable in b/w.

##### Share on other sites
Hodgman    51234
I read a SIGGRAPH paper a while ago that might be useful for this - it was a technique for converting color photographs to black and white, but it took similar colours into account.
[EDIT]
This, or this might have been the work I was thinking of.

Notice in the regular color->grey algoithm (the GIMP one), it's hard to see the red reflection of the sun on the water, but with the other algorithms the reflection is distinct from the water:

##### Share on other sites
OrangyTang    1298
There's an Inkscape plugin which simulates several different types of colour blindness. Source code is included so it might be a good starting point:

import coloreffectclass C(coloreffect.ColorEffect):  def __init__(self):    coloreffect.ColorEffect.__init__(self)    self.OptionParser.add_option("-t", "--type",        action="store", type="string",         dest="type", default="normal",        help="type of vision")  def colmod(self,r,g,b):    if self.options.type=='normal':      return '%02x%02x%02x' % (r,g,b)        typedict={       #'normal':       [1    , 0    , 0    ,    0    , 1    , 0    ,    0    , 0     ,1    ],        'protanopia':   [0.567, 0.433, 0    ,    0.558, 0.442, 0    ,    0    , 0.242 ,0.758],        'protanomaly':  [0.817, 0.183, 0    ,    0.333, 0.667, 0    ,    0    , 0.125 ,0.875],        'deuteranopia': [0.625, 0.375, 0    ,    0.7  , 0.3  , 0    ,    0    , 0.3   ,0.7  ],        'deuteranomaly':[0.8  , 0.2  , 0    ,    0.258, 0.742, 0    ,    0    , 0.142 ,0.858],        'tritanopia':   [0.95 , 0.05 , 0    ,    0    , 0.433, 0.567,    0    , 0.475 ,0.525],        'tritanomaly':  [0.967, 0.033, 0    ,    0    , 0.733, 0.267,    0    , 0.183 ,0.817],        'achromatopsia':[0.299, 0.587, 0.114,    0.299, 0.587, 0.114,    0.299, 0.587 ,0.114],        'achromatomaly':[0.618, 0.320, 0.062,    0.163, 0.775, 0.062,    0.163, 0.320 ,0.516]    }    m=typedict[self.options.type]    r2=r*m[0]+g*m[1]+b*m[2]    g2=r*m[3]+g*m[4]+b*m[5]    b2=r*m[6]+g*m[7]+b*m[8]    r=min(int(round((r2))), 255)    g=min(int(round((g2))), 255)    b=min(int(round((b2))), 255)       return '%02x%02x%02x' % (r,g,b)c = C()c.affect()