Pages: 1 [2]   Go Down

Author Topic: Questions about 0-255 scale  (Read 9639 times)

luxborealis

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2798
    • luxBorealis.com - photography by Terry McDonald
Re:
« Reply #20 on: December 03, 2014, 09:20:46 pm »

Note that Lightroom does not show 256 levels but rather 0-100% in .1 increments so 1000 levels. Files could be 8-bit 12,14 bit raw 16 or 32 bit TIFF so a fixed 256 scale would be strange. A raw file is not even RGB yet so it doesn't make sense to show a 8 bit RGB value. But you can do that with soft proofing if you want to.

I disliked this about LR when I first switched from PS years ago, but after a month, it made complete sense, especially when working with images beyond 8-bit as all my raw files are. Even a 1% difference makes very little visual difference on-screen or in prints, except at the very top of the highlight range.
Logged
Terry McDonald - luxBorealis.com

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Questions about 0-255 scale
« Reply #21 on: December 03, 2014, 09:34:02 pm »

That is not the way PS works, it uses even numbers from 0 to 32768 and odd numbers from 32769 to 65535 from the entire 16-bit range (0..65535). That makes a total amount of 32769 levels, not 32768. See the 'PHOTOSHOP'S 15-BIT IMAGES' end section in the HISTOGRAMMAR TUTORIAL.



Ok Thanks for the info. I stand corrected. It is not using signed integers but a range of the 16 bit integer so it can performs faster calculations (shifts instead of divisions).

In any case, I don't think that the "unambiguos mid point between black and white" is really a big reason to choose that range, it looks more as a consequence. On the other hand, speeding up calculation is a valid reason (maybe not as relevant today as it was with old slow computers when Photoshop was first created)

Regards,

Schewe

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6229
    • http:www.schewephoto.com
Re: Questions about 0-255 scale
« Reply #22 on: December 03, 2014, 09:57:00 pm »

In any case, I don't think that the "unambiguos mid point between black and white" is really a big reason to choose that range, it looks more as a consequence. On the other hand, speeding up calculation is a valid reason (maybe not as relevant today as it was with old slow computers when Photoshop was first created)

When Photoshop was first developed, anything one could do to speed up calculation was used by the engineers...I don't remember what version started using 15+1 for high bit-depth editing but I think initial 16 bit editing was around Photoshop 5 (not CS5 mind you). It wasn't until Photoshop 7 that more 16 bit editing was added including 16 bit filters and layers & masks. But even back then processing power was limited and tended to be a lot slower than now.

I suppose Adobe could contemplate changing the way actual 16 bit images were handled, but I really REALLY don't think that would ever happen. It would require a massive change in code for what would be in essence, a very limited benefit. I've yet to see or hear about a real full 16-bit devise. Not saying they don't exist (maybe in scientific or medical imaging) but I doubt the loss of precision is really a big deal.
Logged

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Questions about 0-255 scale
« Reply #23 on: December 03, 2014, 10:28:25 pm »

Thanks for the comments and I agree that the improvement would be minimal, if any, by changing the way Photoshop works.

After the explanations and googling about it, I can see the benefits of using the current scheme, except for this:


it uses even numbers from 0 to 32768 and odd numbers from 32769 to 65535 from the entire 16-bit range (0..65535).

I cannot see what would you gain by doing this, does anybody have a hint or a link for further explanations?

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re:
« Reply #24 on: December 04, 2014, 01:21:36 am »

This is just guessing, but that can be the way to keep the 0 and 65535 values used, i.e. a beautifully ended histogram that could have some benefits when subsequent strong 16-bit processing is applied (e.g. curves containing (0,0) and (255,255) when defined in 8-bit notation are expected to keep 0's as 0 but also 65535's as 65535 because they are supposed to work in the same way).

Converting an image from 8-bit to 16-bit in Photoshop also follows this philosophy. 0's become 0, but 1's don't become 256 as one could expect from a binary filling by 00000000 but 257 (well not exactly 257 because it is odd and gets rounded, but the average spacing will be 257 I mean). So 255's become 65335 (note that 255*257=65535) obtaining again a beautifully ended histogram when doing 8 to 16-bit conversions.

1:1 histogram of 8 to 16-bit conversion in PS, the 65535 value is used, and peaks are not spaced at 256 intervals but 257 in average:



Or maybe all this is just a consequence of PS integer arithmetics without any optimisation or reason in mind, and we are just looking at the resulting numbers. When this subject has been debated in the forums with Eric Chan he has never been very clear about it.
« Last Edit: December 04, 2014, 02:33:05 am by Guillermo Luijk »
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Re: Questions about 0-255 scale
« Reply #25 on: December 04, 2014, 07:53:26 am »

I suppose Adobe could contemplate changing the way actual 16 bit images were handled, but I really REALLY don't think that would ever happen. It would require a massive change in code for what would be in essence, a very limited benefit. I've yet to see or hear about a real full 16-bit devise. Not saying they don't exist (maybe in scientific or medical imaging) but I doubt the loss of precision is really a big deal.

I agree that the 15+1 notation provides more than enough precision for display on current screens and for reflection prints, but it is insufficient for HDR where floating point is used. Of course, Photoshop has 32 bit floating point capability, but with a limited set of operations (perhaps similar to the previous situation with 16 bit notation). Dolby Labs is working on a HDR display, but I'm not certain on what bit depth is required.

One raw converter, Rawtherapee, uses 32 bit floating point for its internal operations and claims an advantage over 16 bit. The astronomical program ImagesPlus also uses 32 big floating point When doing 100 iterations of adaptive Richardson-Lucy deconvolution, this helps to avoid accumulation of rounding errors.

One blending mode in Photoshop where 0..65535 would be problematic is overlay, where 50% is the neutral value. 50% of 0..66535 is 32767.5.

Regards,

Bill
« Last Edit: December 04, 2014, 08:01:37 am by bjanes »
Logged

Ellis Vener

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2151
    • http://www.ellisvener.com
Re: Questions about 0-255 scale
« Reply #26 on: December 04, 2014, 11:46:51 am »

Re: 15bit + 1 convention.   Here is one explanation:

from: http://www.peachpit.com/articles/article.aspx?p=1709190&seqNum=2

and this:

from: https://forums.adobe.com/message/3472269

Fair enough.

For giggles, try this experiment.

Open a raw image in your favorite converter and render it to a 16bit image in Photoshop.

Do the following:

1) Add a Levels adjustment layer. Pull the Output White Point (the white slider under the gradient, not the white slider under the histogram in the Levels dialog) from 255 to 1 (or type "1" in the right Output field that originally says 255). This will make the image black.

2) Flatten the layer stack (gulp! look at that histogram!!!).

3) Add a Levels adjustment layer. Pull the white point (not the Output white point) from 255 to 2 (it will only go to 2).

4) Because you can only drag the white point slider to "2", add another Levels adjustment layer above the first levels layer and pull that white point to 128.

5) Stamp or flatten the layer stack.  Refresh the histogram if need be.

Voila! Take a look at the resulting histogram - there are gaps throughout the histogram, but the resulting image looks pretty good compared to the original. What went on in this exercise?

Now, try the same experiment only, after step two, change the document mode from 16bit to 8bit. Then complete steps 3 - 5.

Why is there is difference?

Try the above exercise again by making a blank 16bit document and filing it with a pure white bar, a 50% gray bar and a pure black bar. Also, you can try a black to white gradient. Once you finish step 2 above, use the color sampler and look at the Info palette with the RGB color readout in 8bit mode and then in 16bit mode.

kirk

Great experiment Kirk. Thank you for suggesting it
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20651
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Questions about 0-255 scale
« Reply #27 on: December 04, 2014, 12:20:49 pm »

Where I get confused: these are digital files, made up of 0s and 1s. In 16-bit (let's say greyscale for ease sake), a given pixel's colour is represented by a string of sixteen 0s and 1, e.g. 0010011110101001. Whatever different softwares do to interpret this, the underlying data should have these sixteen bits ... No?
There’s the actual data (and many high bit capture devices are not indeed 16-bit) then how one divides up the numbers. Photoshop considers all high-bit files (10-12-14 etc) to be what it calls “16-bit” and under the hood, the actual numbers differ as discussed. If you have a 12-bit per color capture device, Photoshop treats that as if it were a bit more or less bits per color  ::)

In the end, what can you see? These are number games. A 14-bit color display we’re told, can produce billions of colors. The math is sound, what we can see of those billions of colors is a completely different story.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".
Pages: 1 [2]   Go Up