Measuring color, Part 1
Visual Methods in Science Series
Measuring animal color using digital photography: Part 1
By Nathan Dappen
The evolution of animal coloration is one of my primary interests as an evolutionary biologist. How is color used by various organisms? What evolutionary processes lead to or limit color variation? Why are there often differences in color between males and females or among populations of the same species living in different environments? The study of animal coloration can provide a powerful model for understanding the mechanisms that lead to natural phenotypic variation, and ultimately how this variation influences various evolutionary processes.
To answer questions about color evolution biologists need ways of measuring color. While color may seem straight forward to quantify, those who study it know that it can often be a real headache to measure. This article is part one in a series of short tutorials, which will explain a few ways digital photography can be used to measure animal coloration for research purposes. In this segment, I will briefly explain some of the physics of color in terms of the human visual system, summarize the basics of how cameras create digital images from available light, and explain how to objectively measure the percentage of an animal’s body that is covered by a specific color as well as the actual size of those color patches in the units of your choice using digital photographs.
Why “we” see color: Color, as we experience it, is a qualitative and subjective interpretation of light. Color is the result of our nervous system (i.e. our eyes sending information to our brain) picking up how various wavelengths of light are being absorbed or reflected off of objects around us. Every color that you can imagine seeing is the result of various combinations of light wavelengths between 380nm and 700nm being reflected or absorbed off of objects. Our eyes have three main cone cell types that act as light receptors. These three cone cells peak in absorbance at different wavelengths – low, middle, and high – of the visual spectrum (Figure 1). Low, middle, and high wavelengths correspond roughly to what we think of as blues, greens, and reds respectively – three colors that can be mixed together in specific quantities with black or white to create every imaginable color (See Wikipedia chart below). This “mixing” of different wavelengths of light is essentially what our brain does with the information that it gathers from each receptor in our eye in order to create the various colors that we perceive. (FIGURE 1)
|
|
|
So, here’s a question: what is the color of a red apple in room with no light? If you guessed black, you were wrong. Black is the result of objects absorbing all light. If there is no light in the room, the apple would be colorless—a concept that our brains aren’t really built to understand. The important lesson is that our body’s “measurement” of light wavelengths, is color. This brings up several interesting points. First, not all organisms (or people for that matter) interpret light in the same way. For example, many birds, reptiles and fish can see wavelengths in the ultraviolet spectrum (≈300-400nm) – a spectrum that is wholly invisible to us. While we have three light receptors, many birds have four and some butterflies have six! What this means is that what looks like one color to us, may look very different to another organism. Additionally, many organisms can distinguish between various shades of color much more effectively than we can.
RGB: Most digital cameras on the market use an image-capture method called single-shot, which refers to the number of times the camera’s sensor is exposed to the light passing through the camera lens. When your camera takes a picture, light passes through the lens and hits the sensor, which is made up of many pixels. Most pixels use a Bayer filter mosaic method to capture the light. In the Bayer filter mosaic method each pixel on the sensor has three light-sensitive receptors organized in a checker-board pattern (Figure 2). Each receptor is specifically sensitive to a different range of wavelengths: reds, greens, and blues. When light hits the sensor of most cameras, the raw information collected by your sensors can range anywhere from 8 bits to 16 bits (with most dSLRs in the 12 to 14 bit range). A raw converter will then translate the information in each pixel into three values that range between 1 and 255: one value for red, one for greens and one for blues (hence RGB color space). The specific combination of these red, green and blue values can create almost every color within the human visual system. A one megapixel picture has a million RGB value sets (each pixel has a value between 1-255 for red, green, and blue respectively). That’s a lot of information.
What kind of camera do I need? For my research work, I use a canon Rebel T2i. While I recommend that you use a dSLR, any digital camera that can shoot RAW images and allows the manual setting of white balance and exposure will work just fine. Because the sensors on different cameras have slightly different sensitivities, its best if you use the same camera to take pictures of all the organisms that you want to compare. Keep in mind, most dSLR’s use cutoff filters to eliminate light outside the visual spectrum such as ultraviolet or infrared wavelengths. Many organisms may reflect light at these wavelengths. If you don’t plane to use a camera that can pick-up these wavelengths, it is crucial that you use a spectrometer, before you begin measuring color with digital photographs, to make sure that your organisms do not reflect light outside of what can be perceived by your digital camera.
Step 1 - photographing your organisms: This first step is the most difficult (and most important) step in measuring and comparing animal color. The best way to start is to set up an indoor studio with entirely artificial lighting. Outdoor light environments change constantly and it’s better if you can control as many variables as possible. I use several studio lights and a single flash (although two is better). Even if you are controlling the light environment, I think it’s best to put a white standard in all the images you take. In the off chance that you take several pictures in another light environment, the color standard will allow you standardize the while balance in all of your images. I use a mini Macbeth Color-standard, which is small and relatively inexpensive. I also use a tabletop background; you can make this at home using a sheet or tablecloth.
Set-up your camera on a tripod in a fixed location with one of your flashes hooked to the shoe-mount (if you have two flashes and one of them can act as a slave master, use that in the mount and set up the second flash to eliminate any shadows cast by the shoe mounted flash). Set your lens at a fixed focal length. Use manual exposure for both ambient and flash. Your white balance (and therefore colors) can shift dramatically if the ratio between ambient and flash exposure changes. Differences in the color and size of your subjects will cause this ratio to change unless you have both flash and ambient exposures set manually. I recommend using a remote control to release the shutter. This way, you can hold each organism in a similar position and place while photographing them. It is important that each organism is photographed at the same angle and that the distance from the camera and lights remain the same so that they are equally comparable.
Make sure that the color standard is in clear view within the photo frame and is being exposed by flash lighting in a way that is similar to the organism. Set the white balance on your camera according to the white square on the color standard. Shoot away. If all of your subjects are shot under the same light, with the same exposure in RAW file format, you should be able to objectively and directly compare colors in all of your images.
Step 2 - calculating the proportion of an animal that has a specific color: Transfer the image you took of your organism to your computer and open the image in Photoshop. Below is one image that I took of a lizard that I study (Figure 3).
First, let’s calculate the total area of the lizard’s side. You can see that there is a small portion in the bottom of the image that is not part of the lizard, so we need to select the entire image except for that small portion. To do that, select the Selection tool and press Control A to select the entire image. Next select the quick selection tool. Set the tool to negative (-) in the option bar at the top of the window and carefully deselect the portion of the image that is not part of the lizard (Figure 5).

Now, to know what proportion of the lizard’s side is made-up of black scales you can simply divide the black pixel area by the total number of lizard pixels (53,145/158,699= 0.3349). So, on this lizard, 33.49% of its side is made up of black scales. We can then do the same thing with all the other colors.
Calculating color-patch sizes: Maybe you are not interested in the relative size of a color patch, but instead want to know actual real-life area in a unit other than pixels. Open the original image in Photoshop. The first thing that you will need to do is to set a Measurement Scale. Lucky for us, we put the same color standard in each of these images and can use it to standardize how many pixels in each image actually represent a real-life unit like centimeters or inches.
Take a ruler and measure the distance in mm from one corner to another corner on a single color square on the color standard. In my color standard, a single square is exactly 10mm from corner to corner. To tell Photoshop how many pixels should equal a certain length select Analysis > Set Measurement Scale. The Measurement Scale box will pop up. Make sure that the Preset is set to custom, the Logical Length is set to 10, and the Units are set to mm. The ruler tool will automatically be active. Zoom in on the color standard and trace, from corner to corner, the side of the square on the color standard that you previously measured to be 10mm with the ruler. Once you have done this, click OK in the Measurements Scale Box. Your images will now be set to scale (Figure 9).


