Wednesday, September 24, 2008

HDR Photography

A week or so ago, my iGoogle page featured a 'how to of the day' about HDR (High Dynamic Range) Photography. I like photography and dabble a very tiny bit in it, but nothing serious; I use my little digital camera that I bought two years ago, without much adjustment of exposure or anything like that. I sometimes take some decent pictures, but I know people that put my skills to shame. Likely, I will never be a fantastic photographer; however, I am quite good at post-processing. 

HDR appears to take multiple exposures of the same picture, overlay them, and take different contrasts from each picture to create a composite with a much higher contrast ratio throughout the entire picture. I haven't really looked into the actual mathematics or process behind it, so I could be completely off-base, but that's the impression I get.

When I read the article, I was definitely intrigued by the idea. I went out the next day with the intent of taking several samples for HDR processing. That night, I played around with the recommended freeware HDR program and my samples. While some of the results were interesting and evocative, none were clean enough for my tastes. Dissatisfied, I left the pictures alone, until this morning. I've been distracting myself from other tasks (or faffing around, I believe is the term?) by playing with the pictures some more.

The results of this morning's "research" have been fairly informative. I learned that the basic forms of the algorithms are somewhat bland (perhaps I should increase the exposure bracketing?). The only truly impressive transformations are made by the Mantiuk algorithm with "Contrast Equalization" enabled (I'll label this "CE" in the future); all the other transformations are fairly mundane, though the Reinhard 2005 algorithm seems to do the best job with these mundane transformations. The Mantiuk algorithm with CE, however, kept producing a large amount of dithering. After playing with different types of photos, I learned that it doesn't seem to handle solid colours or subtle gradients very well. When I found a picture with a lot of detail and very little in the way of solid colours, it worked much better.

Through much experimentation, Frey Labs are proud to present the following samples for your consumptive entertainment. If you look at the sky in the top left of the HDR versions, you can see the dithering I was discussing above.

The original rose photograph with no exposure adjustment (click for a larger version):


HDR version, Pregamma 1.0 Mantiuk CE 0.1 Saturation 0.8


HDR version, Pregamma 0.9 Mantiuk CE 0.1 Saturation 1.4


I can play around with the settings to get different results and, of course, do further post-processing in GIMP or Photoshop, but these are the raw output of qtpfsgui 1.9.2. For the best results, you want a lot of detail and very little solid colour. A contrast factor lower than 0.1 will produce ghosting. Contrary to what you might think, lower pre-gamma settings do NOT make the image darker; the tone mapping will create the same brightness with CE turned on, no matter the pre-gamma setting. Lower pre-gamma settings create richer and brighter colours, while higher pre-gamma settings create some washed out Burton-esque results.

The how-to says you need a tripod or stable surface for taking the exposure-bracketed photos. While you don't need one of them, I definitely recommend it. Qtpfsgui has an "Auto Align" feature when you first choose the photographs for the HDR process. The first option, "hugin's", crashes on my system, but the second option, "Median Threshold Bitmap", has worked well for me so far. 

The how-to said that cloud detail is significantly amplified by HDR, but I do not have any samples with which to test that. I will continue playing with my other samples later and post any interesting results.

Saturday, September 6, 2008

Reading for the Story or the Writing

I've been thinking lately about why I enjoy rereading some books and not others. I recently borrowed six of the Dragonlance novels (annotated) to reread for nostalgia. I read them way back in middle school and high school and remember enjoying them immensely. The other night I finished reading about 3/4 of the first book, when I suddenly became bored with it. I skimmed forward to read through the marginalia and glance at important bits revolving around Raistlin, then decided I was done reading, at least the first three novels.


Why can I reread some works, like Bujold's Miles books, Pratchett's Discworld series, or Lovecraft's short stories, while I can't be arsed to read some books a second time, even though I enjoyed the first read? I realized today that the difference is in why I enjoyed the piece. Some writers are good at creating stories, while others are good at crafting language (a few are good at both). The former create an interesting world and series of events that pull you along, always making you want to see what happens next; however, when you already know what happens, you don't have quite as much interest. The latter authors are interesting for how they tell a story, not necessarily what story they are telling. I read these authors because I like to read their prose; I enjoy ingesting the words.

Authors that are interesting for their method, rather than their goal, I can read over and over again. Pratchett's satire is so humourous and insightful that I can read it repeatedly, no matter what he is saying. Lovecraft's skill at evoking indescribable horror and a sense of the fantastic is what attracts me to his work, not his overarching plotlines. I suppose it's much like being able to listen to Sam Jackson or James Earl Jones read a phonebook; it doesn't matter what they are saying, so much as how they say it.

So, while out today, I picked up a collection of Lovecraft short stories that I didn't already own, and the next three novels in the Discworld series. I also bought Anne Rice's Mummy, or Ramses the Damned, but I don't recall if I loved that book for the story or the prose; I shall find out, I suppose.

In other news, I've been infected by British English. It started years ago, when I found certain turns of phrase, spellings, or grammatical conventions to be interesting or more reasonable. I am afraid it is spreading, though. Hopefully I won't start replacing Zs with Ss.

"I am naked and free, like my god."

That is what I saw posted on the back of a bicycle today, the rider of which was a young woman wearing a bikini bottom and flower petals around her nipples. Apparently, being topless in public is not illegal in Portland, which I suppose is appropriate, since men can go topless at will.


For those that haven't been to Portland, this scene is indicative of the atmosphere of Hawthorn District, the area next to which my friend lives. It is pretty much a mix of a hostel-type atmosphere and a heavy dose of hippies. I also saw a young woman walking down the street with homemade fairy wings and a man in black and white striped pants, a black tophat, no shirt, and a large quantity of alcohol in his blood stream.

There are a few dozen shops lining the street over about a mile's length, including vintage and secondhand clothing stores, custom jewelers, a hostel, a Ben & Jerry's, an arms and armor shop, a store with toys and shirts reminiscent of what I would find in some parts of Hong Kong, a Powell's bookstore, a vegetarian Thai restaurant, a few other restaurants and coffee shops... you get the idea.

It's an interesting area and I could enjoy spending some time living in the area, but I'm not sure how long it would entertain me. I'm concerned that, like most places with character, many of the people are just impersonating the character they think they are supposed to have for the area, rather than being their own people. Anyway, I doubt I will be spending too much time here anytime soon, as I don't plan on settling down anywhere in the near future. I just thought I would share a vague idea of the area.