How to convert RGB in nit when controlling the luminance of stimuli

Find the function to convert RGB values into corresponding nit

Check out the converter

Look at the displays below. The oblique rectangle appears to be situated between a foreground light mask with holes and the black background on the left display. The same rectangle, on the other hand, appears as a foreground transparent veil superimposed on a light mask with holes and the black backdrop on the right display. This phenomenon described by Gaetano Kanizsa depends on geometric and photometric features of the two displays in general. The luminance of each display region is one of the most important photometric factors. The fact that the luminance of the rectangle is substantially greater than the luminance of the background but slightly lower than the luminance of the mask determines the right display’s apparent transparency. The deceptive appearance of transparency vanishes when this pattern is reversed, as shown on the left.

BOT displays

Luminance is a key notion of perception. However, measuring the exact luminance of a stimulus is a sneaky task. A key problem is that luminance in the retinal image are a product, not only of the actual physical shade of gray of the imaged surfaces, but also of the intensity of the light illuminating those surfaces.

When programming an experiment, the luminance values you can enter in your software do not correspond to the luminance observed by our eyes. A photometer is required to determine the exact luminance of a stimulus in a given monitor. The best technique is to use a phomoter to record a sample of grayscale values directly from the monitor you’ll be using for your experiment. At this point, you can create a function to convert every possible software’s input values into corresponding luminance values for that monitor.

The application below solve this task. Most of the software require a luminance value expressed in the RGB (HSL) scale.

  1. decide a reasonable sample of 10 grayscale values from white to black;
  2. draw a stimulus using your software and fill it with a value from your grayscale sample;
  3. use a photometer to measure several times each square - averaging these measurements will give you a good approximation of the actual luminance (nit);
  4. input the RGB and the nit values in the app;
  5. substitute the variable x of the equation with a value in RGB. The equation will compute the predicted values of luminance in nit.

Check out the converter

Andrea Dissegna
Andrea Dissegna
Post-doc researcher

My research interests include animal cognition, learning and individual differences.