Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

jagged histogram


Recommended Posts

Hi everyone

The histogram on a processed tif is nice and smooth. That of the same image converted to jpg is jagged. 

Could anyone give us a one liner explanation?

Cheers and clear -new moon- skies.

1776342987_Screenshotfrom2019-05-3109-45-17.thumb.png.ad8e6b531aa2a2b66da0235826a47937.png  903746130_Screenshotfrom2019-05-3109-42-21.thumb.png.cede9201d58a5ee6fc99025b3e5a29f7.png

Link to comment
Share on other sites

Not sure if I can give a one liner for that, but let's try.

Jpeg is lossy compression - meaning that format changes pixel values in the image. It does that so information is more compressible while trying to preserve perceptional uniformity / similarity to original image. On top of that, Jpeg is inherently 8bit format, while tiff can be higher bit count (and usually is - like 16bit).

When converting values from 0-1 range (float point precision) to range 0-255 there is rounding as 0-255 is integer format. Rounding creates "stepped" graph of values. These two factors combined produce jagged looking histogram.

Changing compression ratio of Jpeg image will change level of jaggedness of histogram up to a point - where all the jaggedness in histogram is due to rounding of values - same histogram will be produced by for example PNG version of the image (which employs lossless compression and therefore preserves true 0-255 values).

You don't have to save image to observe change in histogram due to lower bit count - just create a copy of working image and convert it to lower bit count by use of Image/Precision/8bit integer menu command.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, alacant said:

Thanks vlaiv. So are we converting tif 0-65535 to jpg 0-255?

Cheers

Yes, whenever you save image for display on computer/web - like png/bmp or jpg you are using 8bit format. Png and bmp support higher bit formats but you need to set that explicitly. In any case, most displays work with 8bit or less (very rarely 10bit), but OS just works with 8bit images anyway when displaying something on the screen.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.