Showing posts with label HDR. Show all posts
Showing posts with label HDR. Show all posts

Friday, June 1, 2012

Using HDR techniques to correct poor exposure

Wikimedia Commons is a really awesome thing. Almost 13 million images and other files, every one of them free to use for whatever purpose you want. But it falls victim to Sturgeon's Law - 90% of everything is crap.

The good news is, that's okay. With that many files, there's a good change of finding a high-quality one, and even mediocre images are okay for a lot of purposes. Most images used on Wikipedia, for example, are resized to thumbnails between 150 and 300 pixels wide. So an image that's poor at 2048x1536 or 4000x3000 might still be usable at 220x165.

One of the advantages of Commons, though, is that it is a wiki. Almost everything is editable, including images themselves. If you have a technically superior version - an updated map, a larger version of a historic image - then you can upload it to replace the current image.

An aside: I'm not a great photographer. Sometimes, I'm not even a good photographer. But I have a pretty good digital camera, and I'm learning. I've learned to play with shutter speed and f-stop to get better pictures than the automatic setting. I've figured out the right combination (1/1600 second, f/3.4, ISO 400) to get surprisingly decent shots out the window of trains at speed. Through a lot of practice, and by taking multiple shots of a scene to choose the best, I've gotten to a point where I'm reasonably happy with my photography. I even get lucky sometimes and grab a neat shot of a train or click the shutter button at exactly the right time from a moving car.

Mostly, though, I don't take perfect images. So I've learned some tricks of digital manipulation. (Even the two linked above got some tweaking for color and contrast.) I don't add anything that's not there, but I work to turn an imperfect snapshot into a more accurate representation of what was in front of me. Cropping, straightening, recoloring, contrast-enhancing, et cetera.

It's actually a lot of fun, and I've even started performing such edits on images that other people have uploaded. I won't make minor tweaks, but I do make major changes that significantly improve the appearance of an image in an article.

The most frustrating images to improve are badly overexposed and underexposed images. They're just so washed out with white or grey than no automated contrast adjustment can save them. But I've been playing with a technique that sometimes can.

The key is a process that's already out there - HDR tonemapping, where individual low-contrast images can be turned into a higher-contrast composite. The results, when properly done, can be spectacular. Even my middling efforts can generate eye-popping color.

The only problem is, HDR composites require multiple starting images. But what if you use an image editor to create multiple versions of your original? Turns out, it works.

I started with this image by another editor at Commons:


It's not an awful image, but it's not great either. The light rail car and the platforms are washed out, while the trees are shrouded in darkness. First, I used GIMP to create two alternate versions. One is shifted by 100 lighter on the brightness menu, and the other 100 darker:




















Then, I fed those two versions plus the original into Luminance HDR, another freeware program which I use for my regular HDR images. With a little tweaking, I got these two output images:





















I then went into GIMP and faded the first of those HDR results with the original, obtaining this next image. It's better than either the original or the HDR result, but still imperfect:




















Finally, I faded that image with the second HDR result and, with more tweaking, I obtained an image I'm happy with. The contrast is markedly improved, and the colors are realistic again.



It makes an excellent display image for Wikipedia, and it looks a lot better than the original at 300 pixels wide. The HDR process does lose some detail; at full resolution, there's a lot of graininess that wasn't in the original. Fortunately, though, Commons saves all versions on an image that were uploaded. So my version displays on Wikipedia articles, but the original image is still available for download and use as well.

Sunday, May 6, 2012

I'm not dead.... yet

College is taking all of my time and then some right now. Summer will hopefully bring adventures, rocketry, and longer posts. But for now, you get a photoblog. Brookline Hills station on the D Branch, from above...
...and in HDR:
 
An Amtrak train passes Hyde Park at track speed:
 A commuter rail train blows past Forest Hills:

Tuesday, February 28, 2012

Return (and HDR images!)

I'm going to be slow getting back into blogging; that monthlong break was not just about SOPA but also because my schedule is crazy this semester.

I'm be writing again soon, but for now here's some HDR (high dynamic range) images I've taken recently. I'll write more about them soon. Most link back to their Wikimedia Commons page.

This first one is in fact the first HDR image I took: The island platform for tracks 1 and 3 at Back Bay, which serves 4 southside commuter rail lines plus Amtrak's Northeast Corridor services. Like most of these images, this went through an absurd amount of processing. I started by taking multiple exposure of the same scene with the camera held absolutely still; here, I rested it in front of me on a bench and took 1/8, 1/4, 1/2, and 1-second exposures.

Even with the camera steady, the images aren't perfectly aligned. I went into GIMP and carefully rotated and slid each image by hand to line them up perfectly, then cropped them so I had four images that were pixel-to-pixel aligned. At that point, I could actually feed them into Luminance HDR, a freeware program which offers a dozen different HDR algorithms. If, like this one, none of the results were exactly what I wanted, then I saved several of the best, then stacked them in GIMP. For this, I combined one image that gave the best blacks with two that combined for good colors.



This one, of the facade of the Westerly train station, built in 1912 by the New York, New Haven and Hartford Railroad (and now used by Amtrak), is not actually a true HDR image. I actually took a single image and made darker and lighter versions, then put those into Luminance. The result is an HDR-style image from a single starting image.



The Castle (Smithsonian Institution Building) on the Mall in Washington, D.C. This image contains ghost images of tourists who moved between exposures.


I just finished this one of Marsh Chapel here at BU last night. Despite some noisy images (Boston is quite dark at 2:00 am) it turned out well.






This is a modernist chandelier on display at the Museum of Fine Arts.

Sunday, December 25, 2011

Merry Christmas


(High Dynamic Range (HDR) image created from a stack of 4 images with exposures ranging from 1/16 to 8 seconds, combined with Luminance HDR (using Ashikhmin algorithm))