Thursday, February 3, 2011

My Photo Tweaks; photo editing with the GIMP

If you've viewed other posts in this blog, you know that I rely heavily on photographs to convey impressions and to make the blog appealing. A discussion I had with Chris at Talus Lodge about post-processing of photographs, using pen and napkin, inspired me to put a blog post about photography on my to-do list. Now, five months later, I'm finally getting around to it. I hope you will find it interesting, particularly if, like me, you prefer to casually work with photos before displaying them.

Processing a single photograph is just the beginning, it turns out. Later posts will take a peek at combining photographs for a panorama, using multiple images for high dynamic range, assembling photographs into a video, and extracting images from a video.  I apologize in advance for any lack of clarity, excessive detail, or omitted points in these posts.

The first thing I do in editing an image is to crop the photo to either frame the scene better, or to zoom in on a feature of interest. After all, my current camera, a Panasonic Lumix ZS-3, can produce images that are 3648 pixels wide, whereas the pictures that I post to the blog are about 1000 pixels wide (there are still a lot of computer monitors out there that are only 1024 pixels across). There's plenty of room for cropping.

Because I am a big open-source fan -- my home PCs have been running Linux for at least a dozen years -- I use a program called the GIMP for photo processing. (GIMP stands for GNU Image Manipulation Program. GNU stands for GNU's Not Unix.) It is available for both Windows and Mac OS X as well as Linux. Here is a screen capture of a simple cropping operation using the GIMP.

Note: if the playback is too small to see well because of the width constraint of the blog, click on the full-screen icon on the far right of the playback bar. Depending on the resolution of your monitor, this may work better.



Once the image is cropped, I move on to enhancement with the Adjust Color Curves feature (from the Color menu, select Curves). The histogram, or distribution of pixels from darkest to lightest, is then presented:

In the above histogram, there are few if any extremely dark or extremely light pixels. (You can see a shade guide along the bottom, with darkest at the left and brightest at the right.) The 'Channel' selection allows you to manipulate just the red, green, or blue component of the image, or the overall brightness level, called value. To expand the range of the brightness level, aka improve contrast, I change the 'value' channel.

The histogram is from this low-contrast image:

The trick is to improve the contrast without going too far and creating garish or cartoon-like coloring. The Adjust Color Curves function allows you to manipulate the pixel distribution with great flexibility, more so than programs that sport a single 'contrast' adjustment or perhaps split the adjustment into predefined high-, medium- and low- (or shadow) tones.

Here is a demo of the mechanics of Adjust Color Curves. You use the mouse to alter the shape of the diagonal line that represents the mapping of the original brightness for a pixel (the X value) to a new brightness (the Y value). At the start, the line is a perfect diagonal, so that each pixel's new value is the same as the old. In this example, I drag the endpoints of this line closer to where pixels actually start showing up in the distribution, and the image changes as the line changes. I then bring up Adjust Color Curves once more, and the histogram now reflects the alterations.


Here's that new histogram, showing the distribution of the pixels after I used Adjust Color Curves. The general shape is the same, but spread out a bit to occupy a greater range of brightnesses.
I did not eliminate all the empty space on either flank of the histogram, because if I had, the changes would have been garish. Small adjustments can be made fully, but for large adjustments I usually don't grab more than 50% of what's possible.

As the last step of the above demo, I also ran the 'Unsharp Mask' function. This is an image-sharpening feature, useful for soft-focus or hazy images. I have learned tread lightly here; for instance, the 'amount' field, which is how much of the calculated adjustment to actually apply, I typically set in the 35%-40% range. Also, faces of people usually look better if you don't highlight their bumps, creases, and shadows -- I just skip sharpening those images.  There are techniques to apply sharpening to just the edges within an image I intend to try out. As always, there is the Undo command in the Edit menu if I mess up!

The results of the 'Unsharp Mask' may not be visible with the screen resolution of this demo. That's OK; in this case, subtle is better. Here is the histogram after Unsharp Mask.
I should mention that the line doesn't have to remain straight. You can add points to the line and adjust only portions of it; that's the wonderful power of this tool. Here's a mapping that brightens the lighter bits as well as increasing contrast:

If I had wanted to tone down the bright areas (bringing out structure in sunlit clouds, for example) I would have lowered rather than raised the rightmost portion of the line.

The next post will talk about stitching together a panorama and about generating a High Dynamic Range (HDR) image, both multi-image creations.

No comments:

Post a Comment

Comments may not appear immediately as they are moderated by the author to eliminate spam.