Pages: 1 [2]   Go Down

Author Topic: Is there a case for developing linear instead of gamma for some scenes?  (Read 17401 times)

xpatUSA

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 390
    • Blog
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #20 on: April 25, 2014, 09:56:27 pm »

Jim, thanks for the time and effort that you put into the above simulation - quite illuminating!

Although my original post was of a general nature, I should have noted that the Sigma SD9 does an awful lot of preconditioning in-camera; including several matrix operations, a linearization look-up table and, I believe Huffman compression. The net result being 16bit values for image data in the X3F with possible saturated values well over 10,000. (On other fora, I have become wearily accustomed to being told that the three ADCs are 12bit so "how can numbers exceed 4095?"). Histograms show missing codes in the dark areas but somehow interpolation or something sets in at quite a low level. Sigma being a law unto themselves, we just have to take it as it comes   :D

Did some comparison work on the flower, please see attachment.

cheers,
« Last Edit: April 25, 2014, 09:58:36 pm by xpatUSA »
Logged
best regards,

Ted

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2370
    • The Last Word
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #21 on: April 25, 2014, 11:43:53 pm »

Although my original post was of a general nature, I should have noted that the Sigma SD9 does an awful lot of preconditioning in-camera; including several matrix operations, a linearization look-up table and, I believe Huffman compression. The net result being 16bit values for image data in the X3F with possible saturated values well over 10,000. (On other fora, I have become wearily accustomed to being told that the three ADCs are 12bit so "how can numbers exceed 4095?"). Histograms show missing codes in the dark areas but somehow interpolation or something sets in at quite a low level. Sigma being a law unto themselves, we just have to take it as it comes  

Ted,

Yes, the old question of how much precision we need for intermediate values, and how does that relate to initial and final precision. There are no easy answers without knowing the precise calculations involved, which is why when I do image processing in Matlab, I nearly always use 64-bit floating point and take the easy way out.

But even assuming that all 16 bits coming our of the camera are meaningful, look at how much photon noise there is compared to the relatively  minor histogram changes caused by the histogram depopulation due to gamma compression.

This may be old news to you, but about a year ago I did a series of posts on histogram depopulation:

http://blog.kasson.com/?p=1648

Thanks,

Jim

xpatUSA

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 390
    • Blog
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #22 on: April 26, 2014, 12:06:47 am »

Ted,

Yes, the old question of how much precision we need for intermediate values, and how does that relate to initial and final precision. There are no easy answers without knowing the precise calculations involved, which is why when I do image processing in Matlab, I nearly always use 64-bit floating point and take the easy way out.

But even assuming that all 16 bits coming our of the camera are meaningful, look at how much photon noise there is compared to the relatively  minor histogram changes caused by the histogram depopulation due to gamma compression.

This may be old news to you, but about a year ago I did a series of posts on histogram depopulation:

http://blog.kasson.com/?p=1648

Thanks for the link - this sentence stood out for me: "If we had a histogram tool with 65,536 “buckets” we’d see the gaps."

It is why I like RawDigger for it's excellent histograms - one per raw channel, log or lin X or Y - and the levels can be 'zoomed' in to show just a narrow part of the X-axis thereby getting down to 1-bit bins.

cheers,
Logged
best regards,

Ted

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #23 on: April 26, 2014, 04:05:31 am »

I appreciate the problem: dificulty in keeping contrast in bright highlights.  I can think of recent examples I've had in yellow flower petals and in cloud details. 

Lightroom, which I use mostly, converts to 16-bit linear gamma anyway, so the problem of a greater-than-unity gamma is deferred to a later stage - normally after any tone adjustment.

Hi Simon,

I've been warning people about the default behavior of Lightroom and ACR with Process version 2012, it significantly compresses highlight tonality. You need to reduce the Highlights slider a lot (upto -100 !) to undo that, to restore some sparkle and detail.

Cheers,
Bart

Logged
== If you do what you did, you'll get what you got. ==

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #24 on: April 26, 2014, 09:06:04 am »

Thanks for the link - this sentence stood out for me: "If we had a histogram tool with 65,536 “buckets” we’d see the gaps."

Guillermo Luijk has written such a program, Histogrammar. It can zoom into a histogram with 65536 buckets. The latest version is Ver 1.2. Unfortunately, it has an expiration date and will not run unless you change the system clock to an earlier date.

Bill
Logged

Simon Garrett

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 742
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #25 on: April 26, 2014, 09:16:33 am »

Hi Simon,

I've been warning people about the default behavior of Lightroom and ACR with Process version 2012, it significantly compresses highlight tonality. You need to reduce the Highlights slider a lot (upto -100 !) to undo that, to restore some sparkle and detail.

Cheers,
Bart

Yes, I agree.  Overall I find PV2012 is great improvement over PV2010, and one can (well, I can) extract detail in highlights more easily with highlights/whites sliders than by using curves.  However, it does have a tendency by default to compress highlights.  I assume this is part of a fairly agressive attempt to prevent highlight clipping.

One good thing about PV2012 is that you can swing the sliders between -100 and +100, more often than not without unpleasant artefacts or a "processed" look.   
Logged

xpatUSA

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 390
    • Blog
Re: Is there a case for developing linear instead of gamma for some scenes?
« Reply #26 on: April 27, 2014, 09:04:36 am »

Some egg on my face, but a big step forward in understanding!

The last comparison shot that I posted of the yellow flower - both images had gamma  :-[

It turns out that if you select linear gamma in DCraw v9.19 (-g 1 1) and sRGB (-o 1) the selection of sRGB overrides the gamma option selection. (Haven't tested if it does the same without a specific color space selection.)

As if that was not irritating enough, the shot itself happened to be taken in Sigma LO res, which on an SD9 gives effectively 18.24um pixels (true 2x2 binning on-chip). It comes as no surprise therefore that RawTherapee was able to bring up individual pixels when playing with local contrast, micro-contrast and sharpening. Thus what I naively thought was detail was actually (wait for it Jim) noise - lots of it - in spite of the slight reduction afforded by binning.

A hard lesson learned via public embarrassment which has caused me to rethink my camera and shooting needs   :-\

Thanks  to all,
Logged
best regards,

Ted

Fine_Art

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1172

There is a good reason to use linear, bright snow. In the past I have used linear to separate out detail in snow. In the last year I paid close attention to what you actually SEE when you are out in bright conditions. The snow does actually look shades of grey. People look at a winter scene then think it looks wrong if the snow is not white white. They need to actually go out in the stuff. The image where people say the snow looks dirty is actually what it looks like.

example

Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914

There is a good reason to use linear, bright snow. In the past I have used linear to separate out detail in snow. In the last year I paid close attention to what you actually SEE when you are out in bright conditions. The snow does actually look shades of grey.

Hi Arthur,

And another benefit of linear is that more subtle differences in highlight rendering are preserved, ready to get enhanced with e.g. Topaz Clarity (see attachment, with only snow enhancement), which adds the play of light over the surface.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==
Pages: 1 [2]   Go Up