Color SinesColor Vision, Periodic Functions and Computer Technology

Overview:

Your task in this activity is to control the color of a single pixel—one of the thousands of colored dots which combine to make up the display on a television or computer monitor. You will start with direct control of the pixel, then move on to create mathematical functions that control the color automatically as a function of time.

Background:

Color is a complex topic with links to many different fields of research and many different types of applications. Major contributions to our understanding of color have come from people as diverse as physicists Isaac Newton and Albert Einstein, biologist Margaret Livingstone, psychologist Kimberly Jameson, medical researcher David Hubel, artist Johannes Itten and many others. Important contemporary uses of color range from packaging to interior design to oil painting to the intense competition among TV manufacturers trying to produce the biggest, sharpest, brightest and most realistic images.

Much discussion about color focuses on the three “primary colors,” but there are several different sets of primary colors in wide use. Artists typically use red, yellow and blue as their primary colors when they mix oil pigments. Printers (including both commercial printers and color desktop printers) typically use magenta, yellow and cyan as their primary colors and add black as a fourth ink. Both of these systems are designed to produce color in reflected light. Devices which emit light (such as TV screens, computer monitors and multi-colored signs) almost always use red, green and blue (RGB) as their primary colors. These RGB emitters of light correspond most directly with the receptor cells that absorb light in the human eye.

Despite all the talk about primary colors, light actually exists as a continuous spectrum of colors. Modern physicists and chemists understand that none of the “primary colors” are substantially different from the other colors of the spectrum—orange, violet, etc. From their perspective, each true color corresponds to a specific wavelength of electromagnetic waves and to a specific energy level for its photons. Red light, for example, has a longer wavelength than violet light. Red light is also emitted and absorbed in wave-packets (photons), each of which has less energy than a photon of violet light. The physicists and chemists also like to emphasize that visible light is just one small part of the full electromagnetic spectrum, which also includes radio waves, microwaves, infrared, ultraviolet, x-rays and gamma rays. The “primary colors” of visible light remain extremely important, however, to human perception.

The existence of “primary colors” is caused by features of the human eye, not by the physical nature of light. The retina of the human eye has three types of cones (color receptor cells) and people perceive color based on the strength of response from these cells. The human eye cannot distinguish, for example, between a true yellow and the combination of red and green, since both produce the same pattern of excitement in the cones. Spectrometers, prisms and other devices can let us see the “truth” about color, but most technical and artistic applications only aim to produce the desired response from the people who view their products directly. It is less expensive and just as effective, for example, to create the appearance of “orange” by mixing red and green light in the correct proportion rather than adding an extra orange emitter to every pixel on a TV screen or computer monitor.

PART 1 Exploring and Adjusting the Apparatus

Connect the RGB Color Mixer to the DIG/SONIC port on the CBL2 or the DIG/SONIC 1 port on the LabPro. Also be sure the calculator is connected correctly to the CBL2 or LabPro interface. Run the CLRSINES program and select the option to “set white.” The ball (which represents a pixel) should glow. You may need to reduce the light in the room to see the glow clearly.

Like most apparatus, the RGB Color Mixer needs to be calibrated. There are similar adjustments, either automatic or manual, on TVs and computer monitors. To calibrate the Color Mixer for maximum brightness and correct color:

  • Use a small screwdriver to turn the white screw on each of the blue potentiometers fully (but gently) clockwise. This should give you maximum brightness, but the display may not yet be white.
  • If the display is not white, turn down the one or two colors that appear until the display is white. At least one of the three potentiometers should still be at its maximum clockwise position.
  1. Be very careful not to touch the incandescent bulb. After you complete the white adjustment, compare the white color of the RGB Color Mixer with the color of an ordinary incandescent light bulb, using just your eye to view them both. Are both lights the same shade of white, or does one appear bluer or more orange that the other? Write your answer on the Report Form.
  2. Now use the spectrometer to view both the RGB Color Mixer and the incandescent bulb. On the Report Form, sketch the two spectra as seen through the spectrometer, being careful to show how the colors align with the numbered scale.

One of the great achievements in the establishment of modern quantum physics was the realization that the energy of a photon of light can be calculated as E = h c / λ, where h is Planck’s constant (6.63 x 10-34 Js), c is the speed of light (3.00 x 108 m/s), and λ (lambda) is the wavelength of the light in meters. Most spectrometers show the wavelength of the light in nanometers (nm), and the wavelengths for visible light fall between about 400 and 700 nm. (One nanometer is 1 x 10-9 meters. Some spectrometers use the older unit of angstroms, Ǻ, where 1 angstrom is 1 x 10-10 meters.)

  1. Record on the Report Form the wavelength of light at the center of each of the three color bands produced by the Color Mixer. Use the relationship above to calculate the energy of one photon of each color. Record your answers in both joules (J) and electron-volts (eV), where 1 eV = 1.60 x 10-19 J.

The integrated circuit used in the RGB Color Mixer combines three separate LEDs (light emitting diodes) into a single package. You can see the three diodes in you remove the ball and look closely while the LEDs are off. The manufacturer of the circuit, Sharp Microelectronics of the Americas, reports that the typical forward voltage to produce red light is 2.3 V and the typical voltage needed to produce either green or blue light is 4.2 V.

  1. On the Report Form, calculate the energy released by 1 electron as it passes through each of the three diodes, where E = charge x voltage. Express the charge in electrons and the energy in electron-volts. Compare these values to the values you found in question 3.
  2. Does it require more energy to produce long wavelength light or short wavelength light? How do you know? Record your answer on the Report Form.

Color SinesREPORT FORM (Part 1)

NAME(S) ______

  1. Compare the white color of the RGB Color Mixer with the color of an ordinary incandescent light bulb, using just your eye to view them both. Are both lights the same shade of white, or does one appear bluer or more orange that the other?
  2. Sketch below the spectra you observed for the incandescent bulb and the Color Mixer. Label the major colors you see in each spectrum.

Incandescent Bulb / Color Mixer
  1. Calculate the energy of a typical photon of red, green and blue light from the Color Mixer. Record your answer in both joules (J) and electron-volts (eV), where 1 eV = 1.60 x 10-19 J.

Wavelength
(nm) / Wavelength
(m) / Energy
(J) / Energy
(eV)
RED
GREEN
BLUE
  1. Calculate the energy released by 1 electron as it passes through each of the three diodes, where E = charge x voltage. Express the charge in electrons and the energy in electron-volts. Compare these values to the values you found in question 3.

Energy (eV)
RED
GREEN
BLUE
  1. Does it require more energy to produce a photon of long wavelength light or a photon of short wavelength light? How do you know?

PART 2 “True Color” and Reasonable Approximations

Computer monitors are often rated in terms of their “screeen resolution” and “color depth.” Screen resolution refers to the number of individual pixels on a screen. A monitor might, for example have a screen resolution of “1152 x 864” pixels, meaning that there are 1152 pixels across and 864 down. This requires a total of 1152 x 864 or 995,328 individual emitters, each providing the red, green and blue colors.

  1. To get a sense of scale, calculate the width and height of a computer monitor made up of 995,328 ping-pong ball sized pixels like the one on the RGB Color Mixer. The diameter of a ping-pong ball is about 40 mm. Show your work on the report form.

“Color depth” or “color quality” refers to the number of different colors the screen can display at each pixels. In a sense, the color depth is always three, since monitors can only display red, green and blue. On the other hand, many monitors claim to show “true color” in 16,777,216 variations. This definition of “true color” comes from the monitor’s ability to set each one of the red, green or blue emitters to any of 256 levels of brightness (numbered as integers from 0 through 255. Since any level of one color can be combined with any level of the other two colors, that allows for 256 x 256 x 256 = 16,777,216 possible combinations. There could be even more combinations if the monitor allowed more than 256 brightness levels, but 256 is a convenient value for computers since it corresponds to the information stored in 1 byte (8 bits) of memory for each of the three colors in a pixel. It is also good enough for almost all practical purposes, since not even the most artisitic human eye can actually recognize all the differences among 16 million colors.

Some monitors save computing power by using “high color” instead of “true color.” “High color” uses 32 distinct levels of red, 32 levels of blue and 64 levels of blue. This allows 32 x 32 x 64 or 65,536 possible color combinations, still more than enough for most people. Using “high color” means that the memory required to store the color on each pixel is reduced from 3 bytes to 2 bytes. Earlier computer designers were even more concerned with efficient use of computer memory and computational power and used just 1 byte per pixel, allowing 256 distinct color combinations.

As operated by the Color Sines calculator program and a CBL2 or LabPro, the RGB Color Mixer allows 16 distinct color levels for each of its three primary colors, with the levels numbered as integers from 0 through 15. A level of “0” means that the emitter is off and that color is not emitted. A level of 15 means the color is emitted at the maximum intensity allowed by the physical system. Intermediate levels provide intermediate intensity. A level of “5” on the blue emitter, for example, means that blue is emitted at 5/15ths or one-third of its maximum possible value and value of “10” on the green emitter will produce green light at two-thirds of its maximum. If both occur simultaneously, the light appears as a shade of aqua (between green and blue) but closer to the green.[1]

  1. On the Report Form, calculate the “color depth” of the RGB Color Mixer.

Use the COLOR SINES calculator program to experiment with various combinations of red, green and blue.

  • Start the COLOR SINES program (abreviated as CLRSINES) on the calculator and reset the white if necessary.
  • Select DIGITAL METHODS and try enterring various combination of integers from 0 and 15.
  1. The Report Form provides a table of input values and asks you to describe the resulting color. Note that color names are very subjective and yours may not be the same as the names suggested by others.
  2. The second table on the Report Form describes colors and asks you to find a combination of integers which reproduces that color reasonably well.

Color SinesREPORT FORM (Part 2)

NAME(S) ______

1) Calculate the width and height of a computer monitor made up of 995,328 ping-pong ball sized pixels like the ball on the RGB Color Mixer. The diameter of a ping-pong ball is about 40 mm. Show your work here.

2) Calculate the “color depth” of the RGB Color Mixer.

3) Test each set of input values and describe or name the resulting color. Color names are very subjective and yours may not be the same as the names suggested by others.

Red = 0
Green = 15
Blue = 0 / Red = 13
Green = 2
Blue = 0
Red = 8
Green = 0
Blue = 15 / Red = 8
Green = 8
Blue = 0
Red = 15
Green = 15
Blue = 0 / Red = 10
Green = 15
Blue = 10

4) Experiment to find a combination of integers which gives a reasonable approximation for each color described below.

Red / Red = ___
Green = ___
Blue = ___ / White with a bluish tint / Red = ___
Green = ___
Blue = ___
Aqua / Red = ___
Green = ___
Blue = ___ / Red-orange / Red = ___
Green = ___
Blue = ___

PART 3 Oscillating Colors

The screen of a TV or computer monitor has many thousands of pixels and millions of possible colors and these need to be updated many times per second—far faster than any human could do the calculations or make the adjustments. The technology relies on its electronics to carry out the calculations, but the people who design and maintain that technology still have to understand how it can be done. Demanding users—people who strive to achieve the best possible results from the equipment they buy—also benefit from understanding how color can be programmed mathematically.

This activity has a second purpose as well, since the mathematics used in this activity applies generally to all “harmonic oscillations.” Light itself considers of electrical and magnetic fields in harmonic ocsillation, but other examples include tuning circuits in radios and TVs, the vibrations caused by earthquakes, the musical notes produced by a violin, and the resonances that can destroy a bridge.You may never again program colors quite this way, but the exercise will help you understand and control the mathematics which describes all oscillations. Your immediate assignment, however, is to program the colors of the RGB Color Mixer so they oscillate in controlled, predicable, harmonic ways.

The general equation to describe simple harmonic motion can be written as shown below. Calculators must be in radian mode to use the function as written.

Y = C + A sin(2л f t + φ)

In this equation,

“C” is the “central offset.” It specifies the center point for the oscillation. In many case the offset is zero since the oscillation is alternately positive and negative. Particularly in electronic systems, however, the offset must often be set to a value above zero in order to keep the oscillation from becoming negative. In our color programs, the offset will be “7.5,” which is the middle of our 0 to 15 brightness scale. (It would not make physical sense to progam our light emitter for a negative brightness, unless perhaps we had a device that actually sucked in light rather than emitting it.)

“A” is the “amplitude.” It specifies how far the oscillation can vary from the center point. “A” is always a positive number, but the equation still allows the oscillation to either rise above the center point or drop below the center point by the amoun “A.” Since the maxium brightness availabe with our system is 15 and the minimum is 0, the largest possible amplitude with our system is 7.5.

“f” is the “frequency.” It specifies the number of complete oscillations per second, and has units of hertz (Hz). The higher the frequency, the more rapidly the oscillation progresses.

“φ” (the Greek letter “phi”) is the “phase angle.” It specifies the point in the cycle at which the vibration begins. If φ = 0, then when when t = 0 the oscillation starts at its center point and is increasing. If φ = л/2, the oscillation has a quarter-cycle “head start,” and has already reached its maximum when t = 0. “φ” is most important when you need to consider how two or more different oscillation work together. That happens, for example, if you must coordinate the oscillation of a red LED with the oscillation of a green LED.

“t” is the elapsed time, measured in seconds. Unlike the four constants described above, t is a variable that changes during the vibration. It will begin with a value of zero when you start the oscillation and keep increasing without limit until you or someone else stops the oscillation.