Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: mdijb on August 18, 2019, 04:12:36 pm

Title: Histogram "gaps"
Post by: mdijb on August 18, 2019, 04:12:36 pm
During my processing of images, some steps cause the histogram to change.  Instead of appearing continuous, "gaps" (for lack of a better term) appear.  Attached are images that display what is happening. I have been told that these gaps mean that data is being lost.

So:
1-Is data being lost?  Is the histogram change significant?  Can someone explain why these gap are occurring?

2-Is the image being degraded when they appear?

3- Will these gaps result in reduced image quality on the screen as well as in the print?

MDIJB
Title: Re: Histogram "gaps"
Post by: Slobodan Blagojevic on August 18, 2019, 07:03:45 pm
Are you in 8-bit or 16-bit mode?
Title: Re: Histogram "gaps"
Post by: mdijb on August 18, 2019, 07:10:48 pm
16 bit mostly.

MDIJB
Title: Re: Histogram "gaps"
Post by: digitaldog on August 18, 2019, 07:31:33 pm
Be sure to click on the triangle or the Histogram isn't accurate (it's cached).
And:

Everything you thought you wanted to know about Histograms
Another exhaustive 40 minute video examining:

What are histograms. In Photoshop, ACR, Lightroom.
Histograms: clipping color and tones, color spaces and color gamut.
Histogram and Photoshop’s Level’s command.
Histograms don’t tell us our images are good (examples).
Misconceptions about histograms. How they lie.
Histograms and Expose To The Right (ETTR).
Are histograms useful and if so, how?

Low rez (YouTube): http://www.youtube.com/watch?v=EjPsP4HhHhE (http://www.youtube.com/watch?v=EjPsP4HhHhE)
High rez: http://digitaldog.net/files/Histogram_Video.mov (http://digitaldog.net/files/Histogram_Video.mov)
Title: Re: Histogram "gaps"
Post by: nirpat89 on August 18, 2019, 07:40:12 pm
Click on that little triangle on the top right, the histogram should improve.  Something to do with cached data vs actual current document. 
Title: Re: Histogram "gaps"
Post by: fdisilvestro on August 19, 2019, 01:09:24 am
First step is to update the histogram as other have suggested. In any case, Photoshop adjustments are performed with integer maths, which will cause gaps in the histogram, and I would say:  "Do not worry about it"
Title: Re: Histogram "gaps"
Post by: JaapD on August 19, 2019, 01:14:13 pm
The integer math does not necessarily clarify the gaps. Gaps are a result of missing codes. Integer math results in truncation what could result in identical neighbor codes.
Simple example: dividing the integer range 4,5,6,7,8 by 2 results in 2,3,3,4,4. So no missing codes.

Regards,
Jaap.
Title: Re: Histogram "gaps"
Post by: Jim Kasson on August 19, 2019, 01:19:25 pm
The integer math does not necessarily clarify the gaps. Gaps are a result of missing codes. Integer math results in truncation what could result in identical neighbor codes.
Simple example: dividing the integer range 4,5,6,7,8 by 2 results in 2,3,3,4,4. So no missing codes.
Try dividing it by 0.5.
Title: Re: Histogram "gaps"
Post by: fdisilvestro on August 19, 2019, 03:12:40 pm
The integer math does not necessarily clarify the gaps. Gaps are a result of missing codes. Integer math results in truncation what could result in identical neighbor codes.
Simple example: dividing the integer range 4,5,6,7,8 by 2 results in 2,3,3,4,4. So no missing codes.

Regards,
Jaap.

Now try to multiply 2,3,3,4,4 by 2 and you get 4,6,6,8,8. See the gaps? Integer maths not only create the gaps, it also does not take you back to the same values if you do the opposite operation. (BTW, dividing is reducing exposure, multiplying is increasing exposure)

In any case, I repeat: Do not worry about it!
Title: Re: Histogram "gaps"
Post by: Jim Kasson on August 19, 2019, 04:00:20 pm
Now try to multiply 2,3,3,4,4 by 2 ...

I said divide by 0.5. Po-tay-toe, Po-tah-toe.
Title: Re: Histogram "gaps"
Post by: mdijb on August 19, 2019, 05:15:37 pm
Thanks for the replies.  I sort of understand the math, but my real basic question remains--do i need to worry about this if the gaps occur?  One respondent has indicated  that I do not.  Do others agree with this?

MDIJB
Title: Re: Histogram "gaps"
Post by: fdisilvestro on August 19, 2019, 05:18:45 pm
I said divide by 0.5. Po-tay-toe, Po-tah-toe.


Yes, I know it is the same, just in case someone says that 0.5 is not integer.
Title: Re: Histogram "gaps"
Post by: earlybird on August 19, 2019, 05:24:26 pm
Assuming one is starting with a continuous tone image, an easy way to purposefully cause its histogram to display gaps is to run a posterize adjustment.

If you expect an image to have a continuous tone character and gaps in the histogram appear after you have applied processes then it seems like evidence that you may be, to some degree, losing some of tonal nuances.

Does it matter? I think I would want to formulate my opinion on a case by case basis.
Title: Re: Histogram "gaps"
Post by: fdisilvestro on August 19, 2019, 05:25:52 pm
Thanks for the replies.  I sort of understand the math, but my real basic question remains--do i need to worry about this if the gaps occur?  One respondent has indicated  that I do not.  Do others agree with this?

MDIJB

Even many raw files have gaps in the histogram. Nikon NEF have gaps in the red and blue channel in all histograms. High ISO images have gaps since high ISO is achieved by multiplication most of the time. It would take a while before gaps translate into banding, and if it happens, just add a tiny amount of noise.
Title: Re: Histogram "gaps"
Post by: digitaldog on August 19, 2019, 05:34:46 pm
Thanks for the replies.  I sort of understand the math, but my real basic question remains--do i need to worry about this if the gaps occur?  One respondent has indicated  that I do not.  Do others agree with this?

MDIJB
Addressed in video.
Title: Re: Histogram "gaps"
Post by: Jim Kasson on August 19, 2019, 05:45:12 pm
Thanks for the replies.  I sort of understand the math, but my real basic question remains--do i need to worry about this if the gaps occur?

 In 8-bit precision files, sometimes the gaps can cause visible contouring in the image. This was the bane of some of us during the bad old days before Photoshop adopted 15-bit-plus-one-state precision, at which point, most of us stopped worrying about it. It was especially problematic in large color spaces like CIELab and ProPhotoRGB, but that's history.

Jim
Title: Re: Histogram "gaps"
Post by: Bart_van_der_Wolf on August 19, 2019, 07:02:40 pm
In 8-bit precision files, sometimes the gaps can cause visible contouring in the image. This was the bane of some of us during the bad old days before Photoshop adopted 15-bit-plus-one-state precision, at which point, most of us stopped worrying about it. It was especially problematic in large color spaces like CIELab and ProPhotoRGB, but that's history.

Yes, that's correct. But it still means that it's better to e.g. convert between colorspaces in '16'-b/ch mode, and use dithering when changing to 8-b/ch mode. This can help in a print pipeline that's usually 8-b/ch. An application like Qimage will do that by default.

Cheers,
Bart
Title: Re: Histogram "gaps"
Post by: digitaldog on August 19, 2019, 08:47:10 pm
Yes, that's correct. But it still means that it's better to e.g. convert between colorspaces in '16'-b/ch mode, and use dithering when changing to 8-b/ch mode. This can help in a print pipeline that's usually 8-b/ch. An application like Qimage will do that by default.

Cheers,
Bart
According to Chris Cox (former Adobe Photoshop engineer):

If you have an 8 bit source and need to apply extreme adjustments – then there might be some advantage to converting to 16 bit and dithering when converting back to 8 bit.
In general, starting with an 8 bit image – you’ve already lost most of your detail.
Dithering only happens when converting DOWN depths.   There is no point (or purpose) in dithering when converting from 8 to 16, or 16 to 32.
Chris

As far as automatic:
Camera Raw/LR has always added dither automatically when sending rendered images to Ps and saving them to disk  (JPEG, TIFF, PSD, etc.), for both 8-bit and 16-bit bit depths.

Also from Adobe:
The dither step is only added when quantizing from higher bit depths to lower bit depths.  For example, when we’re going to display an image inside of ACR/Lr, we need to send an output image at 8 bits.  But our internal processing is done at 16-bit or 32-bits, and the source data that we start from (say, a raw file) is also high bit depth.
When you save a JPEG file from ACR/Lr, the same thing happens.  JPEGs are 8 bits, so quantization from 16/32 bits still occurs, so there is still benefit from applying dither.
Title: Re: Histogram "gaps"
Post by: D Fuller on August 20, 2019, 05:57:47 pm
According to Chris Cox (former Adobe Photoshop engineer):

If you have an 8 bit source and need to apply extreme adjustments – then there might be some advantage to converting to 16 bit and dithering when converting back to 8 bit.
In general, starting with an 8 bit image – you’ve already lost most of your detail.
Dithering only happens when converting DOWN depths.   There is no point (or purpose) in dithering when converting from 8 to 16, or 16 to 32.
Chris

As far as automatic:
Camera Raw/LR has always added dither automatically when sending rendered images to Ps and saving them to disk  (JPEG, TIFF, PSD, etc.), for both 8-bit and 16-bit bit depths.

Also from Adobe:
The dither step is only added when quantizing from higher bit depths to lower bit depths.  For example, when we’re going to display an image inside of ACR/Lr, we need to send an output image at 8 bits.  But our internal processing is done at 16-bit or 32-bits, and the source data that we start from (say, a raw file) is also high bit depth.
When you save a JPEG file from ACR/Lr, the same thing happens.  JPEGs are 8 bits, so quantization from 16/32 bits still occurs, so there is still benefit from applying dither.
I usually output 16-bit tiffs from photoshop, but for those times when I need to produce a jpeg, how does one apply dither? I don’t remember any option for that in the jpeg dialog.
Title: Re: Histogram "gaps"
Post by: digitaldog on August 20, 2019, 05:59:35 pm
I usually output 16-bit tiffs from photoshop, but for those times when I need to produce a jpeg, how does one apply dither? I don’t remember any option for that in the jpeg dialog.
JPEG is 8-bits per color. So dither will be applied from the 16-bit data UNLESS you have this option OFF in Color Settings.
Title: Re: Histogram "gaps"
Post by: D Fuller on August 20, 2019, 07:00:59 pm
JPEG is 8-bits per color. So dither will be applied from the 16-bit data UNLESS you have this option OFF in Color Settings.

Got it. Thanks.