LIGHTROOM: Auto Tone - an algorithm that works!

  • 1
  • Idea
  • Updated 4 years ago
  • (Edited)
A self-created and proven (manually through several folders of photos) very good Auto Tone algorithm (with Exposure left at 0.00)

Free for you to implement in Lightroom, etc. :-)

(My fingers are sore from heavy Lenovo trackpad cursor key use applying this manually to lots of holiday photos!)

This algorithm appears to give results of identical tone compared with the Pentax K-3 out of camera jpegs: See https://www.amazon.co.uk/clouddrive/s... (click the cloud icon below the picture)

The Exposure adjustment appears the most tricky to accurately set, so it might make sense to put this on its own Auto button? Or not do Auto Exposure, since often it appears that the picture is fine with Exposure left at 0.00

Automated "Hold ALT then adjust" method... (of course, analyse the cropped selection, not the entire imported image)

a. Set all Tone and Presence to 0 (including Exposure)

(I also personally choose to set Contrast = +10 and Clarity = +5 at this point)

(Simply increasing Whites up until first appearance of non-black pixels (clipping) in the following wouldn't allow for small very bright lamps which would
probably cause a much darker overall image, because these very bright pixels barely respond to the White slider)

b1. Whites = -100

b2. If necessary, Whites up in steps of 10 until non-black pixels appear (else set to -100 if always clipping)

b3. Continue Whites up in steps of 10 until a step causes the number of non-black pixels to rapidly increase by a "large percentage"
(from a number of pixels >10 to avoid calculation noise issues seen in Lr5.6, e.g. if the number of pixels starts at 2, but drops back to 0 until a higher slider position).
(percentage since number of pixels depends on image size)

b4. Whites back down by 20

c1. Blacks = -100

c2. Blacks up until all pixels are white

d1. Highlights = -100

d2. If necessary, Highlights up in steps of 10 until non-black pixels appear (else set to 85 if stays black, but if Whites were set to -100, set Highlights to 0 instead of 85)

d3. Continue Highlights up in steps of 10 until a step causes the number of non-black pixels to rapidly increase by a "large percentage" (from a number >10).

d4. Highlights back down by 20

e1. Shadows = -100

e2. Shadows up until all pixels are white (else set to 0 if all pixels are already white at -100)

Separate second Auto button for Exposure?...

If necessary, adjust Exposure (there is probably a better way than this!)
a. Down and back up until the Shadow Clipping triangle in the Histogram just turns black. Note this Lower value.
b. Up and back down until the Highlight Clipping triangle in the Histogram just turns black. Note this Upper value.
c. Set Exposure to ((Upper-Lower)/2) + Lower (signed values)

This exposure setting seems to work for most but not all DNG files. There's probably a much better way?

Paul Taylor
prtaylor73 thisishereonlytopreventspambots@gmail...
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
Jpg from k-3
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3367 DNG after algorithm
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3367 DNG after Auto
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3367 DNG after Auto, then exposure dropped to 0 and contrast dropped to 10
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
This snap doesn't contain many highlights or shadows. I'll look for a different example...
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3367 DNG after algorithm with exposure 0 contrast +10
(All these shown have Clarity 0)
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3384 jpg from k3
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3384 DNG after Auto
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3384 DNG after Auto then exposure 0 contrast was already 10
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
IMGP3384 DNG after algorithm with exposure 0 contrast +10
(Again, clarity on all is left at 0, and original jpgs are cropped only)
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Interesting idea Paul.

I wonder in what percentage of cases is this algorithm:

* better than Lr's native
* worse
* about the same..

?
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
Hello Rob,

There seems to be a feeling that the Auto button currently results in pictures that are too bright. (As a new Lr user, I didn't feel that I was content to leave the sliders where Auto put them -- so a search on Auto tone and there have been previous discussions about it.)

If I click Auto after using my algorithm, the sliders can sometimes change a lot, so its not a subtle change. I could post a lot more examples, but its not too specific to any particular photo in the improvement in detail?

My approach isn't anything new, it just is setting each ALT-key-held display on the threshold to get maximum details in both shadow and highlight areas. Look at the detail in the sea and the coastline in the distance in the last thumbnail above and compare with the jpg and Lr Auto ones, it's significantly better! (these open when clicked to view them 1600x900).

All I did is read up on the best sequence to set the sliders in, try doing it manually, then try to describe a way that the software might do this, and do as good a job as I can!

I hope that this alternative algorithm may be added to a future Lr release, with a choice of different Auto methods unless this is 'the way it should always be done' (it is to me). The colours sometimes look too saturated, but the sliders can all be near the centre, and dropping Contrast and Clarity to 0 makes little difference, so its just that I'm used to seeing dull jpg files from horrible lenses?

As a user of lesser small-sensor cameras and jpg files, I'm amazed how good the DSLR imported DNG files look, even before maximising details in Lr.

All the photos linked above are at default Lr sharpening (DNG from Pentax k-3 with a Sigma 18-250 Macro lens), so I'm not even setting Lr for the better detail possible from slightly increased sharpness.

I'll think if I can show a comparison between a couple of dozen randomly chosen different pictures, Auto and Manual thumbnails all in one picture...

Thanks,
Paul
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
A few comparisons are shown in https://www.amazon.co.uk/clouddrive/s...

Maybe Auto shows more colour and detail in shadows, but less colour and detail in lit areas - although the last 3384 photo above, manually set, shows much more clear detail inside the tunnel, as well as in the distance outside?
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
Perhaps this algorithm is intended to nearly fill the span between black and white, so flat looking pictures are brought to life (not a new thing), but the darkest areas of the picture end up near black and the brightest near white.

Whereas Auto pulls the darker areas up to be more clearly seen, but maybe too much is pulled up, bleaching colour (and detail?) of the brighter areas?

Paul
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Hey Paul,

Maybe if Adobe supports the ability to get fresh histogram data via the SDK, you can program your own auto-tone algorithms (e.g. via customization of a plugin like Gazoo.

It can be done now, but it's problematic without better SDK support.

Anyway, maybe Adobe will learn from your pioneering work - thanks.

Rob
Photo of Paul Taylor

Paul Taylor

  • 16 Posts
  • 0 Reply Likes
Thanks Rob. Maybe they'll add something in 5.7 if I'm lucky :-)

Paul