Raising luminosity from near-black

If a pixel was black (or very near it) in the original image, and the output calls for a medium or high luminosity, what colour should the result be? Gray? Will this look odd if the surrounding pixels were dark purple? What if the original pixel was (RGB: 0, 0, 1), should the result be a fully-saturated blue? Again, this may look odd if the surrounding colours are a bit different, as the difference between the colours will become unnaturally exaggerated. This can be a problem, as the lower bits, especially for darker colours, are not always reliable in digital images.

The problem is illustrated below.

Case 1: "Wales"

In this image from Wales (thanks Liam Quin), the stones will be brightened.

[A dark image of a stone wall in Wales.  Photo credit: Liam Quin.]

Here is the result our attempts to preserve saturation gleaned from the dark pixels [Strength & Brightness Adjust: 0.90, Terms: 40, Detail size: 30, Color method: "Add White"]:

The rock wall is filled with brightly coloured orange, red, and purple stones.

The near-flourescent reds and oranges in the rocks probably aren't very representative of their original colours. The fact that the image was taken by a webcam and then saved as a lossy jpeg may have contributed to unreliable chromacity information. In any case, the next image, generated with Martin Weber's corrections for dark colours, has stones that look much more like stones.

A much more subdued wall.

For reference, you may want to check ACE's grayscale output of the scene.

Case 2: "Forest Floor"

This image (from Garrett LeSage of LinuxArt) is a clear canidate for Adaptive Contrast Enhancement. The patterns spanning shadow and sunlight are the sorts of things that would be hard to extract with any other tool.

[Tire tracks on a dusty road through shadow and sun, with pine needles on the side.]

Now, let's look at what happens with ACE and the colours. [Strength: 1.0, Brightness Adjust: 0.95, Iterations: 40, Detail Size: 28, Color Method: "Add White"]

[The ACE-filtered version of the above.]

Not only can we see the patterns made by the tire tracks in both the sunlight and the shadow now, but we've discovered a young branch with green pine-needles hiding in the shade in the lower-left.

Here's the image again, with the "dark colour correction" turned on this time.

It's similar to the last image, but with much less colour.

We've lost almost all the colour here, and if that weren't a tragedy in itself, our branch of green pine needles are now almost impossible to pick out. So it seems that our original algorithm, which exaggerated the colours so unreasonably in our Wales image, was just what was needed here.

[Again, you may wish refer to the grayscale output for a luminosity reference.]

Questions, comments, reservations, and pointers to appropriate resources are strongly encouraged and appreciated. Please mail them to the address at the bottom of this page.

See also:

Last modified: 2001/07/29 18:19:30
Maintained by Kevin Turner <acapnotic@users.sourceforge.net> [OpenPGP Key]