Thursday, March 31, 2011

Colorblindness

Protanopia- is the type of colorblindness I chose to try and replicate. It affects 1 out of 100 males.
-this is my result-


The picture to the right of the regular color wheel is what my code produces- the circle on the top of it, is the original color wheel which I turned into the color wheel below and to the left of it.

My code starts out once you already have opened a picture-

var idChnM = charIDToTypeID( "ChnM" ); //goes into channel mixer
var desc59 = new ActionDescriptor();
var idpresetKind = stringIDToTypeID( "presetKind" );
var idpresetKindType = stringIDToTypeID( "presetKindType" );
var idpresetKindCustom = stringIDToTypeID( "presetKindCustom" );
desc59.putEnumerated( idpresetKind, idpresetKindType, idpresetKindCustom );
var idRd = charIDToTypeID( "Rd " ); // Under the Red channel-
var desc60 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
var idPrc = charIDToTypeID( "#Prc" );
desc60.putUnitDouble( idRd, idPrc, -171.000000 ); //pulls the scroll bar lower for the red.
var idGrn = charIDToTypeID( "Grn " );
var idPrc = charIDToTypeID( "#Prc" );
desc60.putUnitDouble( idGrn, idPrc, 94.000000 );
var idBl = charIDToTypeID( "Bl " );
var idPrc = charIDToTypeID( "#Prc" );
desc60.putUnitDouble( idBl, idPrc, 14.000000 );
var idChMx = charIDToTypeID( "ChMx" );
desc59.putObject( idRd, idChMx, desc60 );
var idGrn = charIDToTypeID( "Grn " ); // Now in the Green channel
var desc61 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
var idPrc = charIDToTypeID( "#Prc" );
desc61.putUnitDouble( idRd, idPrc, 6.000000 );
var idGrn = charIDToTypeID( "Grn " );
var idPrc = charIDToTypeID( "#Prc" );
desc61.putUnitDouble( idGrn, idPrc, 135.000000 );
var idBl = charIDToTypeID( "Bl " );
var idPrc = charIDToTypeID( "#Prc" );
desc61.putUnitDouble( idBl, idPrc, 19.000000 );
var idChMx = charIDToTypeID( "ChMx" );
desc59.putObject( idGrn, idChMx, desc61 );
var idBl = charIDToTypeID( "Bl " ); //Inside the Blue channel
var desc62 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
var idPrc = charIDToTypeID( "#Prc" );
desc62.putUnitDouble( idRd, idPrc, 12.000000 );
var idGrn = charIDToTypeID( "Grn " );
var idPrc = charIDToTypeID( "#Prc" );
desc62.putUnitDouble( idGrn, idPrc, 17.000000 );
var idBl = charIDToTypeID( "Bl " );
var idPrc = charIDToTypeID( "#Prc" );
desc62.putUnitDouble( idBl, idPrc, 133.000000 );
var idChMx = charIDToTypeID( "ChMx" );
desc59.putObject( idBl, idChMx, desc62 );
executeAction( idChnM, desc59, DialogModes.NO ); // Execute action- channel mixing applied


Image and information source: http://colorvisiontesting.com/color2.htm

No comments:

Post a Comment