Pages: [1] 2   Go Down

Author Topic: Bit precision  (Read 12094 times)

PeterLange

  • Guest
Bit precision
« on: August 06, 2006, 03:30:53 pm »

While I’m currently looking for a new P&S camera, Micheal’s unbiased review on the Powershot S3 IS was very welcome.  One might think that such a camera should offer RAW recording; however, that’s regrettably not the case…  Reading the article carefully, it seems that an ‘old’ strategy could gain ground again – which is to set a camera to Low Contrast & Low Sharpening in order to obtain a less ‘baked’ file for further processing in Photoshop.

Following my thoughts, I did some respective comparison tests with my candid G3 (which also supports Raw).  Purpose was to see how far said approach could be driven with regard to image quality…  Anyway, in this context it was more by mistake that I came across the following effect:

*After* treating an 8 bit file with some ‘heavy’ adjust layers, it was largely possible to avoid a comb-like histogram by changing to 16 bit – *just before* flattening the layers.  Without this trip to 16 bit, considerable voids would have been created. Everything properly compared with an updated histogram.

/>  8 bit image file ‘in’ sRGB
/>  added some adjust layers in Photoshop
(optionally:  />  file saved in psd format)
/>  changed to 16 bit precision
/>  flattened the layers
/>  changed to 8 bit again
(optionally: file saved as JPG or TIFF)

In another discussion some months ago it was concluded that it can make some sense to change an 8 bit file to 16 bit for editing (though there are certainly different opinions). Changing to 16 bit of course doesn’t create real 16 bit precision; however, subsequent processing seems to be carried out in a more precise way…  On this basis I find it interesting that it seems to be basically 'enough' to have 16 bit in place just for the moment when the layers are flattened.  Above sequence shows that the file was never handled at 16 bit which can be quite time-consuming depending on a computer’s capabilities. Also, no 16 bit file had to be saved which can eat up a lot of storage space.

… just found it worth to report.
Comments would be appreciated.

Peter

--
« Last Edit: August 06, 2006, 03:42:14 pm by PeterLange »
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Bit precision
« Reply #1 on: August 06, 2006, 04:59:11 pm »

The flaw is that Photoshop adds a bit of noise in the mode change that can alter the appearance of the histogram giving it less combing...check Color Settings under More Options, uncheck the option to Use Dither and repeat any tests. Odds are you'll still see the combing that adding noise removed. Also, the histogram combing is -NOT- an indicator od anything other than a lack of levels at a certain place. It doesn't mean anything other than the image will be more prone to banding, not that the image HAS banding.
Logged

Jann Lipka

  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
    • http://www.lipka.se
Bit precision
« Reply #2 on: August 07, 2006, 01:40:48 am »

In my opinion , your " fake 8 - 16 " technique
is another evidence that you should trust your eyes, at least as much as your histogram .

There is another way to improve a "comb histogram " .

Just  decrase images size with one or two pixels , and your spikey histogram goes nice and smooth , obviously the image has not improved , but your " histogram aware" customer is happy :-)
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Bit precision
« Reply #3 on: August 07, 2006, 08:56:19 am »

Quote
There is another way to improve a "comb histogram " .
[a href=\"index.php?act=findpost&pid=72724\"][{POST_SNAPBACK}][/a]

A healthy dose of Gaussian Blur will remove any of the combs.

As to the quality of the new edited image.....
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

PeterLange

  • Guest
Bit precision
« Reply #4 on: August 07, 2006, 09:16:16 am »

Quote
The flaw is that Photoshop adds a bit of noise in the mode change that can alter the appearance of the histogram giving it less combing...check Color Settings under More Options, uncheck the option to Use Dither and repeat any tests.]
Well – there seem to be two different mechanisms involved.

Photoshop indeed 'dithers' the conversion from 16 bit down to 8 bit.
Just remembered David Dunthorn’s notes on this subject
(though I disagree with many of his opinions):
http://www.c-f-systems.com/Phototips.html

However, doing what you suggest (‘use dither’ disabled)
there’s still less combing with above suggested trip to 16 bit
compared to a pure 8 bit route.

When an adjust layer like e.g. a steep curve is applied with 16 bit precision
(on data which are essentially spread with 8 bit distances)
I would expect that this creates many in-between values on an 8 scale.
Changing back to 8 bit seems to lead to a more proper, gentler rounding
than applying the curve on a pure 8 bit basis… At least this *could* be an explanation.


Quote
Also, the histogram combing is -NOT- an indicator od anything other than a lack of levels at a certain place. It doesn't mean anything other than the image will be more prone to banding, not that the image HAS banding.
[a href=\"index.php?act=findpost&pid=72710\"][{POST_SNAPBACK}][/a]

Yep. Perfectly agreed.
I would call it as a kind of 'pre-damage'.


Peter

--
« Last Edit: August 07, 2006, 09:28:34 am by PeterLange »
Logged

Jonathan Wienke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 5829
    • http://visual-vacations.com/
Bit precision
« Reply #5 on: August 07, 2006, 02:03:30 pm »

Here's a better idea:

1. Open the JPEG in PS.

2. Convert to 16-bit mode.

3. Run Neat Image, Noise Ninja, or other similar noise reduction tool. This will interpret the "all values are divisible by 256" property of the JPEG data as a type of noise, and will adjust the data values so that they are NOT all evenly divisible by 256 after noise removal.

Now you can run your levels, curves, and other adjustments with results about 70-80% as good as working the original RAW, and toothcomb histograms will not be a problem. It's far better than editing in 8-bit mode.
Logged

PeterLange

  • Guest
Bit precision
« Reply #6 on: August 08, 2006, 11:52:45 am »

Quote
Here's a better idea:

1. Open the JPEG in PS.

2. Convert to 16-bit mode.

3. Run Neat Image, Noise Ninja, or other similar noise reduction tool. This will interpret the "all values are divisible by 256" property of the JPEG data as a type of noise, and will adjust the data values so that they are NOT all evenly divisible by 256 after noise removal.

Now you can run your levels, curves, and other adjustments with results about 70-80% as good as working the original RAW, and toothcomb histograms will not be a problem. It's far better than editing in 8-bit mode.
… very clear and comprehensive statement,
much appreciated.

Now for example, let’s take a simple Photoshop technique for color noise reduction:

Option (A.)
1.)  Open the JPEG in PS.
2.)  Convert to 16-bit mode.
3.)  Duplicate the background layer, change to Color blend mode at reduced Opacity of e.g. 75% for a start  -  in order to apply a Gaussian blur of some pixel width.
4.)  Add further adjust layers depending on needs
5.)  Flatten the layers

Option (B.) – just differs by the sequence
1.)  Open the JPEG in PS.
2.)  Duplicate the background layer, change to Color blend mode at reduced Opacity of e.g. 75% for a start  -  in order to apply a Gaussian blur of some pixel width.
3.)  Add further adjust layers depending on needs
4.)  Convert to 16-bit mode.
5.)  Flatten the layers

Both options are not perfectly the same; however, if my tests are correct:  there are said ‘in-between’ data created in both cases;  these are really 16 bit (15 bit more precisely) as they don’t have an even-numbered 8-bit-equivalent anymore.

My point is that it seems to be possible to introduce parts of the 16 bit charm at a quite late stage (when Photoshop really applies & executes the layers for flattening).

Peter

--
« Last Edit: August 08, 2006, 12:02:31 pm by PeterLange »
Logged

Jonathan Wienke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 5829
    • http://visual-vacations.com/
Bit precision
« Reply #7 on: August 08, 2006, 12:33:42 pm »

And mine is that for many editing operations, especially levels, curves, and sharpening, going to 16-bit mode immediately has many tangible benefits. You're giving up a lot by procrastinating.
Logged

PeterLange

  • Guest
Bit precision
« Reply #8 on: August 09, 2006, 04:52:54 am »

Quote
... You're giving up a lot by procrastinating.
Strictly referring to a PS layer structure
-
let’s agree to disagree.

Peter

--
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Bit precision
« Reply #9 on: August 09, 2006, 09:12:19 am »

Quote
Strictly referring to a PS layer structure
-
let’s agree to disagree.
--
[a href=\"index.php?act=findpost&pid=72857\"][{POST_SNAPBACK}][/a]

You can only disagree on the subjective importance, but the facts of arithmetic are that if you edit images in 8-bit mode, they become less and less a representation of the subject, and more and more a collection of mathematical/sampling artifacts that loosely resemble the subject.
« Last Edit: August 09, 2006, 10:21:12 am by John Sheehy »
Logged

PeterLange

  • Guest
Bit precision
« Reply #10 on: August 09, 2006, 02:06:43 pm »

Quote
... but the facts of arithmetic are that if you edit images in 8-bit mode, they become less and less a representation of the subject, and more and more a collection of mathematical/sampling artifacts that loosely resemble the subject.
John,

This is not a Dan Margulis discussion. So far no one advocated for 8 bit only. The question was about how to deal with a given 8 bit file and in particular when to introduce 16 bit.

Here’s a numerical example:

1.)  Create a new file in 8 bit mode (sRGB)
2.)  Fill this background layer with one single color of RGB= 200, 100, 100.

Option (A.)
3.)  Change to 16 bit mode.
The ‘16 bit’ readings from the info pallet should indicate:  25700, 12850, 12850
4.)  Add a New layer to fill it with another color of RGB= 201, 101, 101
The ‘16 bit’ readings from the info pallet should indicate:  25829, 12979, 12979
5.)  Set this layer to 50% Opacity.
6.)  Flatten the layers
The final ‘16 bit’ readings from the info pallet should indicate:  25765, 12915, 12915

Option (B.)
3.)  Add a New layer to fill it with another color of RGB= 201, 101, 101
4.)  Set this layer to 50% Opacity.
5.)  Change to 16 bit mode.
6.)  Flatten the layers
The final ‘16 bit’ readings from the info pallet should indicate:  25765, 12915, 12915


Both options produce the same result. The final numbers represent the arithmetic average of both original colors.  The resulting numbers are really high bit as they don’t have an integer 8-bit-equivalent anymore.

It was not necessary to create the colors in 16 bit mode. The only important thing was to have 16 bit precision in place just when the layers are flattened.  Needless to say that many more examples can be created with Levels, Curves, etc…

In summmary:  You could take the 8 bit file, add all adjust layers needed (for Smoothing, Sharpening, Levels, Curves, etc.), save it as psd file…- …and when you then change to 16 bit mode in order to flatten the layers, it yields real high bit precision.

Peter

--
« Last Edit: August 09, 2006, 02:28:27 pm by PeterLange »
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Bit precision
« Reply #11 on: August 09, 2006, 02:29:52 pm »

Quote
This is not a Dan Margulis discussion.
--
[a href=\"index.php?act=findpost&pid=72892\"][{POST_SNAPBACK}][/a]

Thank goodness. That's a painful experience.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

dalex

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
Bit precision
« Reply #12 on: August 10, 2006, 11:43:15 am »

Quote
The only important thing was to have 16 bit precision in place just when the layers are flattened.



In summmary:  You could take the 8 bit file, add all adjust layers needed (for Smoothing, Sharpening, Levels, Curves, etc.), save it as psd file…- …and when you then change to 16 bit mode in order to flatten the layers, it yields real high bit precision.

...

--
[a href=\"index.php?act=findpost&pid=72892\"][{POST_SNAPBACK}][/a]

I assume that the same is true when merging layers as well (Merge, Merge Up, Merge Visible, etc.)?

This would suggest that for people who like to 'Merge Up' alot while editing, the conversion to 16-bit would have to occur earlier than later.
Logged

Jonathan Wienke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 5829
    • http://visual-vacations.com/
Bit precision
« Reply #13 on: August 10, 2006, 12:05:49 pm »

Quote
It was not necessary to create the colors in 16 bit mode. The only important thing was to have 16 bit precision in place just when the layers are flattened.  Needless to say that many more examples can be created with Levels, Curves, etc…

In summmary:  You could take the 8 bit file, add all adjust layers needed (for Smoothing, Sharpening, Levels, Curves, etc.), save it as psd file…- …and when you then change to 16 bit mode in order to flatten the layers, it yields real high bit precision.

Nonsense. Try taking those colors and do several level or curve adjustments in 8-bit mode, with some sharpening and color corrections added in, like fixing a scan of an underexposed daylight-balanced film negative exposed under fluorescent lighting., flatten, and then do the same sequence of operations in 16-bit mode and flatten, and see if the numbers still match. I have an example of this you can play with here. There's a 16-bit TIFF image you can download, and a Photoshop action that performs the operations. Run the action on the image in 8-bit mode, then do so again in 16-bit mode. The difference is obvious; run the test for yourself if you don't believe the comparison images I posted of the results.

The problem with your premise is that noise reduction and sharpening cannot be done by adjustment layers, and should be done (at least capture sharpening) immediately following RAW conversion in 16-bit mode for best results. By starting out in 8-bit mode, you are screwing up some of the most critical steps in the image editing process. By starting with a JPEG, you have to accept some compromise of final image quality, but you can minimize those compromises with the steps I mentioned earlier. Your proposed editing method does nothing to solve these issues.

Take my sample TIFF, convert it to 8-bit mode, and add adjustment layers to it to make it look as good as possible, then open another copy, leave it in 16-bit mode, add the same set of adjustment layers, and compare the images. I guarantee they won't look the same, and that the 16-bit image will look much better, especially in the shadows.
« Last Edit: August 10, 2006, 12:23:53 pm by Jonathan Wienke »
Logged

PeterLange

  • Guest
Bit precision
« Reply #14 on: August 10, 2006, 06:10:01 pm »

Quote
PeterLange wrote:
>> This is not a Dan Margulis discussion. …<<

Thank goodness. That's a painful experience.
Well – I guess I was too optimistic.

  Peter

--
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Bit precision
« Reply #15 on: August 10, 2006, 06:15:27 pm »

Quote
In summmary:  You could take the 8 bit file, add all adjust layers needed (for Smoothing, Sharpening, Levels, Curves, etc.), save it as psd file…- …and when you then change to 16 bit mode in order to flatten the layers, it yields real high bit precision.
[a href=\"index.php?act=findpost&pid=72892\"][{POST_SNAPBACK}][/a]

Uh, wrong...this will never produce "real high bit precision"...the ONLY thing you'll get is the marginal benefit of doing adjustments in 16 bit on 8 bit images which is indeed marginal.

Note: an adjustment layer created in 8 bit whose file is mode changed to 16 bit will flatten in 16 bit with 16 bit precision of the adjustment, however, if you to a layer mask while in 8 bit, then mode change, the layer mask in 16 bit will only be 8 bit precise. Also, ANYTHING you do with "pixels" while in 8 bit will also be mode changed to 16 bit and suffer the same only marginal benifit.

But in no way can any of this be construed as having "real high bit precision"...the ONLY mild benefit you would get is 16 bit precision adjustments to 8 bit/channel data which is simply not the same as real high bit precision. Face it, if all you start with is 8 bits/channel, the best you'll EVER have is 8 bit precision...
Logged

PeterLange

  • Guest
Bit precision
« Reply #16 on: August 10, 2006, 06:19:54 pm »

Quote
Nonsense. ...
Simple ideas are often most challenging to understand.

In Photoshop, all adjustments and all decisions made by the user are either on an 8-bit scale (0 to 255) or even more roughly ranging from 0 to 100.  I mean who in the world sets the anchor points of a curve with 16-bit precision.

Nonetheless, the operations itself – upon being applied to the image data - can anytime create real high bit values (see above example).  Executing the adjust layers in 8-bit mode leads to a cumulative rounding error.  Executing the adjust layers in 16-bit mode simply prevents this.  But there is NO need to create or store the adjust layers in 16-bit mode.

In short:  there’s no need to write down your order in calligraphy – it just has to be executed as precisely as possible.


Quote
There's a 16-bit TIFF image you can download, ... Take my sample TIFF, convert it to 8-bit mode, and add adjustment layers to it to make it look as good as possible, then open another copy, leave it in 16-bit mode, add the same set of adjustment layers, and compare the images.
You’re changing the rules while the game is running.  We were starting with an 8 bit file.  Also, you persistently refuse to consider the sequence I suggest (layers first, 16 bit then, flatten last).


Quote
The problem with your premise is that noise reduction and sharpening cannot be done by adjustment layers
LOL.

See color noise reduction as suggested above / here:
http://www.luminous-landscape.com/tutorial...-gremlins.shtml

See all kinds of layer-based sharpening techniques:
http://ronbigelow.com/articles/sharpen4/sharpen4.htm
http://www.pixelgenius.com/tips/schewe-sharpening.pdf
from: http://www.pixelgenius.com/tipsandtechniques.html


Peter

--
Logged

PeterLange

  • Guest
Bit precision
« Reply #17 on: August 10, 2006, 07:33:10 pm »

Quote
...
But in no way can any of this be construed as having "real high bit precision"...the ONLY mild benefit you would get is 16 bit precision adjustments to 8 bit/channel data which is simply not the same as real high bit precision. Face it, if all you start with is 8 bits/channel, the best you'll EVER have is 8 bit precision...
8-bit is not simply 8-bit; it’s 8-bit-gamma-encoded.

Face it, camera engineers know what they do (mostly). Starting with the initial analogue-to-digital conversion, the usual precision of 12 bit per channel is maintained through all steps of in-camera processing including gamma encoding. The following equation shall serve for illustration:

RGB_8bit_gamma-encoded = 255 x (RGB_12bit-linear / 4095)^(1/2.2)

Here’s the translation to 8-bit-gamma-encoded (left) from 12bit-linear (right):

0  <-/  0
6  <-/  1
8  <-/  2
10  <-/  3
11  <-/  4
12  <-/  5
13  <-/  6
14  <-/  7
15  <-/  8
16  <-/  9
17  <-/  10
17  <-/  11
18  <-/  12
19  <-/  13
19  <-/  14
20  <-/  15
21  <-/  16
21  <-/  17
22  <-/  18
22  <-/  19
23  <-/  20


You see that you really need every single 12 bit level (linear) to get an almost unbroken scale with 8-bit-gamma-encoded in the shadows (where it really counts).  Even, it would be better to have a 14 or 16 bit input to meet the needs of said 8-bit-gamma-encoded scale.

That is why some people say that 8-bit-gamma-encoded is as much worth as 12-bit-linear.

On this basis, it’s also very nice to reconsider the comparison of levels vs. f-stops…

Peter

--
Logged

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Bit precision
« Reply #18 on: August 10, 2006, 10:39:26 pm »

Quote
8-bit is not simply 8-bit; it’s 8-bit-gamma-encoded.
[a href=\"index.php?act=findpost&pid=73015\"][{POST_SNAPBACK}][/a]

Uh, actually, if you are talking about 8 bit jpgs from a camera, wrong again...while you may end up with preserved luminance data in a camera jpg, the amount of compression going on in color means you actually end up with more like 7.5 bits of prescision in a camera jpg.

You seem hellbent on trying to convince yourself that camera jpgs are less bad than they are and that somehow, majically, converting to 16 bit for edits gives you something. It gives you a "little bit" of enhanced precision only in the color/tone adjustments but nowhere near "high bit precision". About all you can say is it's less bad than pure 8 bit editing...but not by much.
« Last Edit: August 10, 2006, 10:40:43 pm by Schewe »
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Bit precision
« Reply #19 on: August 10, 2006, 11:39:18 pm »

Quote
8-bit is not simply 8-bit; it’s 8-bit-gamma-encoded.

Face it, camera engineers know what they do (mostly).
[a href=\"index.php?act=findpost&pid=73015\"][{POST_SNAPBACK}][/a]

Yes, they know that the camera will still sell if its JPEGs are not good representations of the sensor capture.

8-bit gamma adjusted data can have a tremendous amount of DR.  Its highest value with 2.2 gamma is about 196,000x as high as its lowest value, as opposed to about 4000:1 for 12-bit RAW data.  Unfortunately, JPEGs made by cameras simply don't use it very well, because they are made not to capture DR but to look good subjectively, while saving storage space.  The shadows are typically posterized, blocky, and have color biases near black.  A stop or more of RAW highlights are typically clipped away for the JPEG.  The 12-bit linear RAW data is a much better place to start from, with user-control in a converter optimized for the shot.
Logged
Pages: [1] 2   Go Up