Monday, March 7, 2011

Fluctuation in Fluorescent Lighting

I'VE OFTEN HEARD that fluorescent lamps will quickly fluctuate in color as electric current flows through them. I decided to do a little experiment to see if this is true.  I took a number of photos of a compact fluorescent bulb in rapid succession. The exposure and white balance of the camera was fixed, and the shutter speed was 1/1250 second. Here are four of these photos:

Change of fluorescent bulb color with phase

I saturated the colors here to make them more evident, but they do noticeably fluctuate. If like me you often severely manipulate or saturate your images, you will increase the likeliness of seeing these color shifts. Long exposure times will average out these fluctuations.

The human eye is rather well adapted to changes in the color of lighting from yellow to blue, like we find outdoors on a sunny day or with incandescent lighting. However, fluorescent lamps will produce problematic and sickly-looking green and magenta color casts, especially if there is any natural or incandescent lighting in the scene. This effect is particularly noticeable by the camera. When I am confronted with fluorescent lighting, I will turn it off if possible before starting photography.

Friday, March 4, 2011

Accurate Color Rendition

AN ARTIST ASKS how to get accurate color in photography.  This is a problem. Fairly accurate color rendition is possible, but is not easy to achieve.

Your first goal is to be sure you get accurate white balance. Many digital cameras have the ability to do a manual white balance on the camera, which is achieved by shooting a specially-made target which is guaranteed to be very close to a neutral color. If you place the target at the subject, facing the camera, you can get a very good white balance as long as the lighting conditions are fairly uniform.

I used to have color problems with my digital cameras, particularly, I would not get good red colors, rather they turned out magenta. I got an X-Rite Colorchecker target and used that to calibrate my cameras' colors. It works very well, but you have to shoot RAW, as well as create separate profiles for each lens, ISO, and lighting condition combination. But keep in mind these calibrations are only accurate for a limited number of colors.

X-Rite ColorChecker

Do not expect perfect color rendition, even with calibration. Digital cameras are designed to produce adequate color with an acceptable amount of noise. Some recent Sony cameras, I'm told, produce more accurate colors at the expense of more digital noise. You might want to check http://www.dxomark.com: look up Color Response and the "Sensitivity metamerism index" to see how accurate the colors actually are for a particular brand of camera.

Use your camera's native ISO sensitivity. Boosting ISO will harm color rendition severely: again, look at the DxO mark data to see the degree of harm. Typically, the lowest ISO setting on a camera is the camera's native ISO, but not always; some manufacturers have ‘extended’ settings on both the high and low ends of the ISO scale.

The quality of light is very important. Daylight and incandescent lighting are known to have good, continuous spectra. Using these light sources will give you better results than fluorescent lights, or sodium and mercury vapor lamps. When you use a light with an odd spectrum, your eyes and camera will likely see the colors rather differently. In my experience, fluorescent lights produce magenta and green color casts variably across the image, and so I try to avoid photography under these kinds of lights. According to the Academy of Motion Picture Arts and Sciences, the new LED lighting produces severe color shifts, most critically in skin tones, and so is not recommended for quality work.

Be aware that dark parts of the image, due to nose, will be less accurate. Common techniques used to brighten shadows will also harm color there. Overexposure will greatly harm the colors in an image. If even one of the three color channels is overexposed on an image, the colors at that point will shift: see the article Three Opportunities for Overexposure.

There are highly accurate multispectral cameras, but they are expensive and designed for laboratory use only. The results from such a camera cannot be accurately displayed on a computer monitor.

Cameras produce images within a limited color gamut. The sRGB standard, used by most digital cameras, can only represent about 35% of the range of color that can be seen by the human eye. If you shoot RAW, or set your camera to Adobe RGB then you can capture more colors, but unless you know what you are doing, you will end up with images that look pale and unsaturated: the opposite of what you want. Even if you use a wide color gamut, your monitor and printer will likely not be able to show you those extra colors. Colors that come from rare and expensive pigments or dyes, such as the colors produced by Murex shells, typically are at the extreme of human color vision, and may be out of a digital camera's gamut.

If you want to be able to measure color in the real world accurately, perhaps you can invest in a spectrophotometer. Pantone makes one, but it only outputs the closest Pantone color, so it is not strictly accurate, but I would guess it is far more accurate than a digital camera. Alternatively, you can invest in a collection of Pantone color chips: you can visually match colors. Munsell chips are also available, but are also very expensive. If you only want to match one particular color, then your job is much easier. Even if you can't see it accurately on your monitor, you still will be able to print it if you use spot colors or if you use one of the excellent wide-gamut desktop printers.

Friday, February 18, 2011

A Black and White Conversion

THERE ARE SOME occasions when a photo can be improved by converting it to black and white. Typically, I find these are photos taken at night, particularly with high ISO under sodium vapor lighting. Here is another example:

Downtown Clayton at dusk - color

The shadow detail here is weak, and all my standard techniques for lightening dark detail looks unsatisfactory. But after converting the image to black and white, I was able to put severe curves on the image, as well as high levels of local contrast enhancement.

Downtown Clayton at dusk - monochrome

You can bring up large amounts of shadow detail in a monochrome image.

Thursday, January 27, 2011

White Balance, Part 1

PLEASE CONSIDER THIS photo of my living room:

Ritz-Carlton - camera white balance
(Or rather, this is a photo of the lounge at the Ritz-Carlton in Clayton, Missouri.)

Like very many interior photos — taken without a flash — this has a yellowish color cast. Undoubtably this yellow cast is due to the color of the lighting. Obviously incandescent light has a slightly yellower color of light than daylight. So there is no surprise that incandescent photos appear yellow.

Perhaps you think that the white balance feature on your digital camera is simply a minor adjustment. Perhaps it corrects for the slightly yellower color of incandescent lighting. Certainly I thought so.

Here is a white-balanced version of the photo above. I adjusted the photo so that a white object under this lighting was measurably neutral: that is, the red, green, and blue color values of the white object were equal after adjustment.

Ritz-Carlton - neutral white balance

It looks a bit better: the yellow color cast has been removed. A small difference, but I think it improves the photo a bit, for it brings out the variety of colors better, and it is closer to what I remember seeing. I recommend always using a neutral white balance unless you have a specific reason not to do so.

Now consider this photo:

Ritz-Carlton - Daylight white balance

This is very yellow. But this so happens to be the scene assuming a daylight white balance. Were I to take a photo of a white object under bright daylight with this balance, it would look white. Incandescent lighting is actually far more yellow/orange in color than is daylight.

You may not be aware that your eye does an automatic white balance: when you look at a scene, your eyes attempt to subtract out the color of the lighting, and your eyes do a pretty good job of this, up to a point. Cameras work the same way; they also attempt to automatically subtract out the color of the light.

Keep in mind that perceptibly slight changes in the color of light may translate to a radically different objectively measurable difference in color.

Here is a photo taken outdoors, with a Daylight white balance:

Snow - Daylight white balance

And the same photo, with the color balance set to incandescent lighting; it is the same white balance I used in the nicely-corrected interior photo #2 above:

Snow - Incandescent white balance

We see that the camera's white balance corrects for extreme differences in the color of light, not merely minor differences. How the eye corrects for white balance is a mystery, and the technology behind a camera's automatic white balance feature is ultimately imperfect, which is why I do a manual white balance whenever I'm doing my best work.

White Balance and Noise

Digital cameras have an intrinsic, fixed white balance. The color data captured by the camera sensor is adjusted by the camera's computer according to the white balance setting. Here are our sample pictures again, showing what they look like when using my camera's native white balance:

Intrinsic camera white balance

The images are greenish because each green sensor is more sensitive under most lighting conditions than the others.  For more details, see the article What Does the Camera Really See? For an overview of the color system used by digital cameras, read Color Spaces, Part 1: RGB. Digital cameras generally are rather insensitive to blue light.

To correct for the green snow scene above, the camera must amplify both the red and blue color channels to match the green, and whenever you amplify a signal, you also amplify noise.

For the interior scene, the camera must amplify the red channel a little (since incandescent lighting has plenty of red light), while it has to amplify the blue channel a lot, creating plenty of noise.

Here is an extreme example of this sort of noise amplification:

church - three channels

I took this a number of years ago with an inexpensive point-and-shoot camera. While the red and green channels have a lot of noise, due to the camera being set to ISO 1600, the blue channel at the bottom is particularly bad. The blue channel, due to incandescent white balance, was greatly amplified relative to the other channels, and so it shows plenty of noise.

Generally speaking, if you want low-noise interior photos, you are asking a lot of your camera, and you will likely spend a premium to get this.  Read this for details: One Easy Rule for Quality Images.

White Balance and Exposure

If you don't set your white balance correctly, you risk bad exposure if you shoot JPEG. Please note that I define good exposure by taking all three color channels into consideration; see the article Three Opportunities for Overexposure for details. If even one of your three channels is significantly overexposed, you will get shifts in highlight color.  In an extreme case, here is the daylight photo set with an incandescent white balance:

Histograms

This is a selection from Nikon's View NX2 software, showing the three color histograms at this white balance. Each graph has the dark pixels to the left, and the bright pixels on the right: we see here that the red channel is underexposed, white the blue channel is overexposed.  Due to poor white balance, we irrevocably lost both highlight and shadow detail.

The histograms seen here are similar to the three color histograms found on many digital cameras. Like many photographers, I usually check the color histograms to make sure that my photos are exposed properly. In order to use as much of the camera's dynamic range as possible, I try to expose the images as much as I can without overexposing any one of the three histograms.  However, were I to use this process with a poor white balance, I would inevitably get a severely underexposed image. In the image above, reducing the exposure to preserve the blue channel highlights would lead to a severely underexposed red channel:

Histograms - under exposed

Now you might just want to have this ‘look’ in your photo, and that's fine. But if you instead plan on ‘fixing in Photoshop’, forget it.

Please  note that you will see the same problem if you shoot incandescent lighting with bluer white balances — Daylight, Cloudy, and Shade — except your red channel will likely be greatly overexposed while your blue channel will be underexposed.

As a general rule, you will get the best exposure if you use a neutral white balance. You can expose the image longer with less noise and less chance of clipping highlights if you set your white balance precisely.

But please remember that cameras have fixed intrinsic white balance, as seen above. You get a greater risk of overexposing or underexposing color channels when you shoot JPEG images, because the camera throws away lots of its original sensor data when performing a white balance — and you risk throwing away good useful data if you set your white balance wrong. For this reason, I shoot RAW images (which retain all of the original sensor data), because I can adjust the white balance on my computer after the fact. The risk of bad exposure is lessened — although not eliminated — when you shoot RAW and so you still ought to be careful at the time of shooting.

The trade-off is that RAW files need to be processed on your computer to produce an image usable for either printing or displaying on the web. I find the trade-off acceptable, although I know that many photographers do not.

Some authorities state that since a camera has a fixed intrinsic white balance, then the camera exposure histograms ought to show the RAW color channels. I think this is an excellent idea. Some photographers attempt to do this by forcing the camera to use a white balance that does no color adjustment at all: their histograms in this case are correct. The UniWB method of using the camera's own intrinsic white balance was developed by Iliah Borg and others, and the method is described here. It is not for the faint-hearted, since all your photos will turn out green, and you will have to correct for white balance on your computer. You can however get better exposure. At the very least, this is a good learning tool, if not really practical.

Note to camera manufacturers: please show the RAW histograms when shooting RAW! Also, give the ability to zoom in to the brightest pixels on the histograms, for overexposure in digital photography is worse than underexposure. When you show blinking pixels, be sure that they blink when even one of the channels is overexposed.

When to White Balance and When Not to White Balance

As I mentioned before, I recommend always setting your white balance precisely unless you have a specific need to do otherwise.

Have a look at A Digital Color Wheel. Colors opposite from each other are called opponent colors: a color balance biased towards one edge of the wheel will aways be at the expense of the opposite edge. If your image is too blue you will not get enough yellow, and too much green will mean too little magenta. If the white balance is in the center you will trade off quantity of color for quality of color; a well-white-balanced image will look richer in color content, and you have less risk of having your colors go out of gamut. You can get better results in saturating the colors if your white balance is precisely in the middle.

Sometimes you may want to capture a scene as you remember seeing it; but don't forget that your eye already does strong white balancing. So if you want to capture the warm glow of candlelight, set your white balance to somewhat warmer than neutral. To capture the cold mood of a snowy day, set your white balance to a somewhat cooler balance than neutral. Although your eye does do white balancing, this mechanism doesn't work well under dim lighting, although I am uncertain as to what the actual relationship might be. This is worth further research.

Here is a photo where I did not want the camera to subtract out the color of the light:

City Museum, in Saint Louis, Missouri, USA - Fantastical beast in blue light

A fantastical beast, at the City Museum in Saint Louis. Click the image twice to view it on black.

Sometimes you may want an image with a strong overall color tone, but you may get better results if you first convert the image to black and white, and then add a tone afterwards, not relying on white balance.

Mixed Lighting

Your eyes not only do an automatic white balance, but they adjust this white balance variably across the scene while you are looking at it. When you take a photo of a scene, and reduce that panorama down to a tiny, low-contrast image displayed on a page or on a screen, this automatic white balance hardly operates, which is why you have to get it right in the camera. A severe problem occurs when you have mixed lighting of multiple colors, for example, when you shoot an interior, illuminated with incandescent lighting, while also having windows to the outside appearing within your photos.  Invariably your windows will look fine with the interior too yellow, or the interior looks fine while the scene outdoors is very blue. The photograph just doesn't look as you see it in real life.

With architectural interiors, I will use daylight white balance for the windows and incandescent white balance for the interior, and then composite these versions of the image. The results are good, even though this is a tedious process. Big-budget cinematographers will put large yellow-colored gels over the outside of the windows so that the color of the transmitted daylight matches the lighting used in the interior.

Far more problematic is when fluorescent lighting is used in an interior. Not only do these lights have an odd color — typically they are simultaneously more yellow and more green than daylight — but fluorescent colors are not constant across brands of lamps. They do not provide a continuous full spectrum of light, and even more problematic, they change color as they quickly flicker 50 or 60 times per second. Almost invariably, if you attempt to white balance fluorescent lighting, you will get strong shades of the opponent colors green and magenta throughout your image. These green/magenta color casts will be considerably increased if you also have daylight or incandescent lights in the scene. If at all possible, I will turn the fluorescent lights off.

Also see the article: White Balance, Part 2: The Gray World Assumption and the Retinex Theory.

Tuesday, January 11, 2011

Challenge: "High Photographic Modernism"

I AM NOW a Challenges host on the dpreview.com website. My first challenge is called High Photographic Modernism, which invites images made in the style of the famous Group f.64.

This is a challenge of straight photography: images ought to have great depth of field, extreme sharpness and detail, little over or under exposure, and generally speaking technically precise with a simple composition — and no special effects. The photos must be black and white, although some toning is acceptable.

Marais Temp Clair Conservation Area, in Portage des Sioux, Missouri, USA - mushroom 2 (black and white)

To enter this challenge, you need to sign up at dpreview. You may enter up to three images from Tuesday,  January 18th, 2011 through Monday, January 24th, 2011. Voting then occurs the week afterwards. When the challenge is finished, you will get an email with your results. Winners receive fame and glory!

For the following week, the theme will be the New Pictorialism. This is inspired by a style of photography popular a century ago, which used classic techniques from painting to make images that were beautiful with a dreamlike quality.

Sunday, December 26, 2010

Focal Length

PHOTOGRAPHY IS NOTORIOUS for its many numbers that a photographer needs to know about. Focal length is one of those numbers.

Most inexpensive compact cameras have an easy-to-use zoom feature, and casual photographers can merely set the zoom to whatever they want without worrying about any confusing numbers. But confusion can occur if they use a camera with interchangeable lenses, for then they need to learn about focal length.

Fortunately for beginners, the kit lens that comes with most inexpensive interchangeable-lens cameras is adequate for most purposes. These cameras may even come with two lenses; for example, 18 to 55 millimeters and 70-200 mm. All you really need to know is that large numbers zoom onto distant objects, while smaller numbers capture ‘more of the scene’.

It's easy. If you want to get the whole scene in your photo, you set your lens to 18 millimeters. If you want to zoom in, you set your lens to 55 mm. But then a friend asks you to take a photo of her, using her camera. You stand about ten feet away, and taking note of the millimeter markings on her lens, you set it to 18 millimeters and then look through the viewfinder — and you are surprised that she appears smaller in the viewfinder than you would expect.  She suggests that you zoom in a bit, using a setting of about 30 millimeters. So 18 mm on your camera is the same as 30 mm on her camera. As it so happens, a nearby photographer is taking a photo of the same scene: his camera is large and he tells you that he is using a 55mm lens — but he too is taking in the whole scene, for 55 millimeters is a wide-angle lens for his camera. You learn that focal length settings are not necessarily commensurate between cameras.

A pinhole lens

Light usually travels in a straight line through air, and so we can construct a very crude, but workable, lens just by making a small hole in an opaque surface. Light will travel in a straight line from an object, through this pinhole, where it reaches its destination, which may be light sensitive film or a digital camera sensor.

Pinhole lens

The focal length of the pinhole lens is merely the distance from your sensor to the pinhole. To illustrate the angle of view of this pinhole lens, draw a line which is the length of your sensor: say, 35 millimeters wide. Perpendicular and centered on this line, draw a dot, which represents your pinhole. Draw a straight line from the edges of the sensor through the dot: this shows the angle of view of your pinhole lens.  If you bring the pinhole closer, the view gets wider; and draw it farther away, and the angle of view gets narrower. You should see that for any given focal length, a larger sensor will give you a wider angle of view. Using trigonometry, you can calculate the angle of view for any combination of sensor size and focal length.  Suppose you have two cameras, one with a sensor twice as wide as the other: doubling the focal length of the pinhole lens on the larger camera will give you precisely the same angle of view as the smaller camera.

Now take a glass lens, and focus it on some object very, very far away, and note the size of the object projected on your sensor. Then take a pinhole lens, and move it closer or farther from the sensor until its projected image is precisely the same size as the image formed by the glass lens. The distance from the pinhole to the sensor is the effective focal length of the glass lens. An 18 millimeter glass lens projects the same size image as would a pinhole located 18 millimeters from the sensor.

But please note that this equivalence between a glass lens and pinhole lens only works when the distance from lens to the object is much greater than the distance from the lens to the sensor. A regular camera lens, after all, is not a tiny dot like our pinhole lens, but rather is made of multiple thick chunks of glass. If you focus a glass lens upon a subject very close by — like when using a macro lens to focus on a small insect — then its effective focal length will change considerably. Click here for more details.

Also note that this equivalence only works when a glass lens produces a rectilinear image — where straight lines in the scene translate to straight lines on the image. Fisheye lenses are a bit more complicated since they produce so much distortion.

Equivalent focal length

Serious photographers use seriously large cameras. This is for the simple reason that large camera sensors — either digital or film — naturally produce cleaner, sharper, more detailed images. Click here to see why. Now photojournalists also want good picture quality, but they also lug cameras around all day long, and so they need a camera that is a good compromise between weight and image quality. Photojournalists are typically the most commonly-seen type of professional photographer — and amateurs, in imitation, started using similar equipment, which included the 35mm film format. Vast numbers of amateur-grade, interchangeable-lens 35 millimeter film cameras were produced, most notably by the same manufacturers who made the photojournalist cameras.

People became quite used to the sizes of lenses for these cameras.  For example, a 50mm lens produced an image that looked rather normal — not too zoomed in, and not too wide. Lenses in the range of say 105 millimeters or larger were good for portraits, while 30 millimeter or smaller focal lengths were good for architectural interiors. Now, please recall that these focal length sizes are for 35 mm film; a medium-format camera would use longer focal lengths for the same purposes, while an inexpensive consumer camera would use much shorter focal lengths.

Eventually the manufacturers of photojournalist cameras went digital; alas, however, due high cost, the digital sensor size was smaller than the beloved 35 millimeter film. Because people were so familiar with the focal lengths used by 35 millimeter cameras, manufacturers stated equivalent focal lengths. So an 18 mm lens used with the new digital sensor is said to be equivalent to (that is, provides the same angle of view) a 27 mm lens used on a 35 mm camera. A 35mm lens on these digitals is equivalent to a 50 mm lens on a 35 mm camera. Is this helpful, or confusing?

Because the 35mm format was rather standard, digital cameras with sensors smaller than 35 mm are often called cropped-sensor cameras, although this terminology can be rather confusing to beginners. I find that beginners often get hung up on the marketing term ‘crop factor’. A 20 mm lens on a camera with a crop factor of 1.5 will provide the same angle of view as a 20 mm x 1.5 = 30 mm lens on a 35 millimeter film camera. Now this terminology is likely only useful if you are very familiar with the old 35 millimeter cameras and their lenses, and is otherwise confusing.

If you are a beginner, I would suggest you forget all about equivalent focal lengths and crop factors. Instead, find out the size of your sensor, in millimeters. For example, many consumer digital SLR cameras have a sensor that is about 30 millimeters across on the diagonal. A wide-angle lens will have a value that is less than this measurement, while a telephoto lens will be much larger than this value. A normal lens — for this sensor — will be equal to this size or perhaps a bit larger.

Tuesday, December 21, 2010

A Digital Color Wheel

MOST COLOR WHEELS you find at art stores, or images of wheels you find with Internet searches aren't too helpful for digital photography. While they may illustrate the visual order of the colors, they aren't too helpful if you want to mix colors digitally. They may even be quite misleading. So I created my own color wheel using the primary colors found in the sRGB standard, which is used by digital cameras, computers, and high-definition television.
Color wheel according to the sRGB standard

This color wheel shows the correct relationships between the red, green, and blue colors that are primary in the sRGB color system, as well as their opponent or secondary colors of cyan, magenta, and yellow.

These primary and secondary colors are the brightest and most saturated colors that can be generated from the sRGB color system. The coding in each color circle gives you the formula for generating the color: for example, cyan is GB, which means that Red=0, while Green and Blue = 255. Halfway in between the primaries and secondaries are bright tertiary colors. These tertiaries are coded with lower-case letters indicating half a given color: for example sky blue is coded gB, meaning Red=0, Green=128 and Blue= 255.

Some old color wheels use red, yellow, and blue as primary colors; others use green, purple, and orange as primaries. This is misleading for computer use since they don't give us a good idea of opponent colors.  In this color wheel, if you mix together equal portions of colors opposite to one another, you will get a middle gray color; mixing together blue and yellow gives you a gray where the red, green, and blue values all equal 128.

If your images have a color cast, you can achieve white balance by moving towards the opposite color. An image that is too yellow needs more blue, an image that is too green needs more magenta.

UPDATE: My use of a value of 128 for the tertiary colors is not correct, since 128 is NOT the middle tone. It is for this reason that the wheel does not appear to be visually uniform: the tertiaries appear to be somewhat dark. Updated wheel can be found here.