Mar 21 2009

## Converting Optical Density of a Neutral Target into its RGB code value

Converting Optical Density of a Neutral Target into its RGB code value

Well, the headline seems nerdy. Not really if you are into scanner world. This post it very much a knowledge sharing as I could not find anywhere in the net which says how to do the conversion. Not that it is difficult, but takes some understanding and head twitching to do the conversion.

To know what is Optical Density, refer to this wikipedia article . In layman terms, OD is a unit less measurement of  how much light passes through a sample.

Formula to know
$OD_lambda = log_{10} O = - log_{10} T = - log_{10} left ({I over I_0} right )$

 O = the per-unit opacity T = the per-unit transmittance I0 = the intensity of the incident light beam I = the intensity of the transmitted light beam

if you want a sample to have 50% transmittance, then OD of that sample is

OD (50%) =  -log(.50) = 0.3

A neutral target is one that has equal amount of RGB color coded in it. A OD 0.3 neutral target is one whose transmittance is 50%. Now you ask what is the RGB value of the OD 0.3 neutral target. If we consider 8 bit RGB value, then 0 stands for black and 255 stands for white. For 50% transmittance, then the value should be exactly half and it is 128 for R,G & B.

Now let us say you want to prepare a sample that has OD of 0.6. RGB value for OD 0.6 can be obtained as below

-log10(x) = 0.6
x = 10−0.6  ( Should be read as 10 to the power of -0.6 )
X = .25  ( This is 25% transmittance. )
Hence the RGB code will be ( .25 X 256 ) =  64 each ( i.e R=64, G=64,B=64)

Another example, OD of .08

-log10(x) = .08
x = 10−0.08  ( Should be read as 10 to the power of -0.08)
X = .83  ( This is 83% transmittance. )
Hence the RGB code will be ( .83X 256 ) =  212 each ( i.e R=212, G=212,B=212)