Fixing Photo Contrast with The GIMP
In my last article (LJ, February 2003), I described how to improve candid flash photos by removing red-eye using the GNU Image Manipulation Program (GIMP). In this article, I present another GIMP gem for fixing your photographs: using a digital split neutral density filter to repair bad pictures resulting from shooting high-contrast scenes.
The human eye is a remarkable image capture instrument. It is able to view a scene with a large dynamic range (range of luminosity or brightness) and to discern detail in both bright highlights and dim shadows. Dynamic range in photography is often measured in stops, where each stop represents a doubling or halving of light. Humans can discern detail in a scene with about 14 stops of dynamic range. Film and digital capture sensors are not as adept. Slide film typically can handle around 5-6 stops. Detail in areas below the lower limit is blocked up into dark shadows, and detail above the upper limit shows up as blown-out (completely white) highlights. Negative film does a bit better at 9-10 stops, and some high-end digital cameras (DSLRs) can do even slightly better than that. Typical consumer digicams fare somewhere in the lower middle of the pack and capture about 6-9 stops of detail, depending on the bit depth used in the digital capture process, the sensor size and a few other factors.
Knowledgeable photographers often have dealt with the limited dynamic range of their equipment by trying to compress the dynamic range of the scene they are photographing using fill-flash, lighting or reflectors to light up shadows or special filters, such as a split neutral density filter (sometimes also referred to as a graduated neutral density filter) to darken the highlights. An example of such a filter is shown in Figure 1. It is an accessory you can attach to the front of your lens. It has a clear side and a dark gray side, with a small continuous transition zone dividing them. The dark part of the filter has the effect of reducing light by 1 stop, 2 stops or more, depending on the strength of the filter. When the camera is set up for a high-contrast shot (e.g., a sunset), the filter is positioned in front of the lens so that the dark part covers the highlights (e.g., the sky) and the clear part covers the rest of the image (e.g., everything below the skyline). The photographer then can meter the exposure for the shadows. If the filter is positioned correctly, the metering is accurate, and the photographer has knocked on wood, thrown a pinch of salt over his shoulder and said a short prayer, the whole image will come out properly exposed.
Most casual shooters won't be bothered to carry around split neutral density filters and use them. In such situations, a compromise exposure is the only real option. A typical programmed auto-exposure metering system often will set an exposure that takes the middle road, losing detail at both ends of the luminance range. If you're willing to control the exposure yourself, follow a rule of thumb that is oft-repeated by photographers shooting slide film: expose for the important highlights. It often will be possible to rescue some detail from the shadows later, but once highlights are blown out, there's nothing that can be done to recover that detail. Remember that the rule says “important highlights”. If you are taking a picture of a sunset, you want to preserve the texture and detail in the clouds, which are brilliantly lit by the setting sun; if your main subject is a moose standing in a field at sunset then you'd probably rather have the detail in the moose's fur, and let the cloud detail fare as it will.
Although you can't recover detail that is completely clipped in such exposures, it is often possible to tweak an image to rescue a fair amount that is lurking in the highlights or shadows. The process in traditional wet-film processing is called dodging and burning. When making a print from a negative, parts of the paper are exposed more or less than the rest to hold details in highlights or pull detail from shadows. These sort of machinations used to be reserved for advanced darkroom enthusiasts. However, now anyone with a copy of The GIMP can do all of this and more with considerable ease.
Let me illustrate with the following example: a Utah sunset, shown in Figure 2 loaded into a GIMP window. I had followed the sage advice and exposed for the clouds and highlights on the cliff face and allowed the foreground to go quite dark. Using the LAB decompose plugin, I can decompose this RGB image into the LAB constituents. Of these, the L channel shows the full range of luminance values carried in the image. As you can see from Figure 3, there is a considerable amount of detail in the foreground trees, which in the original image look almost completely blocked up. This is good, but how do I pull out this detail, while retaining the beautiful detail and color of the cliffs and clouds?
The technique for rescuing that shadow detail is a bit like the digital equivalent of using a split ND filter. I combine two versions of the same scene, where each version has been optimized for either highlights or shadows. The technique makes use of layers and layer masks in The GIMP, so it is important to have a basic understanding of what these are beforehand. The next section introduces these concepts and provides a high-level overview of how the overall technique works.
|Speed Up Your Web Site with Varnish||Jun 19, 2013|
|Non-Linux FOSS: libnotify, OS X Style||Jun 18, 2013|
|Containers—Not Virtual Machines—Are the Future Cloud||Jun 17, 2013|
|Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer||Jun 12, 2013|
|Weechat, Irssi's Little Brother||Jun 11, 2013|
|One Tail Just Isn't Enough||Jun 07, 2013|
- Speed Up Your Web Site with Varnish
- Containers—Not Virtual Machines—Are the Future Cloud
- Linux Systems Administrator
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- RSS Feeds
- Reply to comment | Linux Journal
3 hours 25 min ago
- Yeah, user namespaces are
4 hours 41 min ago
- Cari Uang
8 hours 13 min ago
- user namespaces
11 hours 6 min ago
11 hours 32 min ago
- One advantage with VMs
14 hours 1 min ago
- about info
14 hours 34 min ago
14 hours 35 min ago
14 hours 36 min ago
14 hours 38 min ago
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?