• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Saving 16bpc to JPG - first convert to 8bpc?

Explorer ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

I'm sorry if this is well known but I've only just noticed that if I save a flattened 16bpc image directly to JPG then no dithering is applied to the 8 bit conversion, even though I have the 'Use Dither' option checked in Color Settings.  Is there another setting somewhere to enable dithering on saving a 16bpc image at 8bpc?  Otherwise, the solution looks like converting to 8bpc mode prior to saving the JPG....i.e. an extra operation in the workflow.

Normally I want to enable dithering when converting down to 8bpc, so as to retain a bit of extra shadow detail and reduce perceived banding.  It might explain some of the effects I've noticed that, up until now, I'd blamed on JPG artefacts.

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Jpeg compression in itself creates color banding in soft gradients. That's most likely where the banding comes from - unless you can demonstrate that converting to 8 bit prior to saving as jpeg eliminates it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Yes, when I pixel peep I can clearly see that banding is eliminated (or at least it's dither distributed by the lower order bits) if I drop down to 8-bit before saving as JPG.  It's how I spotted this effect in the first place.  If I drop to 8-bit mode with dither disabled the screen looks remarkably like the JPG image saved from 16-bit mode!

It's not something I was aware of before.  I'd naively assume Photoshop would dither down to 8-bits when saving to JPG.  Still learning something new every day.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Yes you have to change file to 8bit before saving as jpeg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Randy, they made saving directly JPG from higher bit depths a JDI feature with CS5 (I think).  Are you saying that using that feature does not work as well as doing it step by step?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Yes, it looks like saving directly to JPG from 16-bit was a JDI feature with CS5, but I can't see mention that it included dither.

It's easy enough to test.  Simply draw a gentle grey scale grad in 16-bit mode and save to JPG.

Now change to 8-bit mode (with dither enabled in color settings) and save that to JPG.  The difference between the two JPGs should be pretty obvious.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

I have an instinct, not confirmed, that dithering an image is going to introduce discontinuities in the image data which will interact poorly with JPEG compression, which is designed to optimize continuous tone. This means that the dithered version may compress less well or be more prone to artifacts.

This might be why Adobe don't dither. I'd recommend examining compressed size and quality if analysing this issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

I've now tested with a few real life images.  Saving at a JPEG quality of 10 it makes very little difference to the file size if the image is dithered down from 16-bit or not.  Dithering generally adds a fraction of one per cent to the file size, although surprisingly in one case the dithered image file was very slightly smaller.

I doubt Adobe had concerns about applying dithering prior to JPEG compression.  After all, if you work at 8bpc you probably enable dithering when applying grads and when performing colour space conversion, don't you?

Whilst the lack of dither is glaringly apparent on grads, viewing real life images I have to say that I have to look quite closely to notice any difference between a dithered and non-dithered conversion from 16bpc to 8bpc.  I'm therefore surprised I ever spotted it.  As you'd expect, the differences are most apparent in shadow areas, but really only when you've got a good clean source image.  In other words, dithering is probably only of practical benefit when you're dealing with a clean, low ISO shot and/or have incorporated clean tones post process.

I'm still surprised that Adobe don't provide a dither option when saving 16bpc to JPEG.  Or at least follow the option setting for 16bpc to 8bpc conversion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

Finally got around to testing this for myself. I actually get the opposite result. Yes, I did several separate runs to make sure.

Starting with a 16 bit TIFF, I saved out one jpeg directly, and one after converting the TIFF to 8 bits first. As control I also converted the TIFF to 8 bits and saved out that.

The reopened TIFF showed no banding whatsoever, as expected. The two jpegs looked quite horrible in comparison, with lots of banding, but the one saved out directly from the 16 bit file was preferable in every instance. Actually the biggest surprise was how different they were.

In any case I still don't see why a color conversion setting would have any effect on a bit depth conversion? It clearly states that it only applies to 8 bit images to begin with. I think there must be some confusion of concepts here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

It's very odd that we get different results.  I've never noticed banding problems with JPEG, provided I save with a sufficiently high quality setting.  Are you saving the JPEG with the same colour profile as the TIFF because profile conversion might cause banding on display?

I'm using Photoshop CC and the 'Use Dither' conversion option in Color Settings clearly has an effect when switching from 16bpc to 8bpc image modes.  I'm not sure when this was introduced because I can't find an equivalent setting in CS5.1.  Perhaps it exists under a different option menu.

It's very easy to demonstrate with a grey ramp drawn at 16bpc.  I'm new to this forum and haven't attempted to post images before but hopefully attached are three JPGs.  These are all accurate representations of what I see on the screen and the banding has not been introduced by the JPEG conversion.

The first is saved directly from 16bpc.  I can clearly see the steps.

The second is saved from 8bpc, after switching the image mode from 16bpc to 8bpc with the dither option disabled.  The steps are clearly visible, as when saving from 16bpc mode.

The third is saved from 8bpc, after switching the image mode from 16bpc to 8bpc with the dither option enabled.  The steps appear a lot smoother, although of course due to the introduction of dither noise.

16_bit.jpgConverted_to_8_bit_no_dither.jpgConverted_to_8_bit_with_dither.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

What I don't get here is your procedure. How do you change bit depth with or without dither? Yes, it's a checkbox in Color Settings, but what does that have to do with bit depth?

My test was strictly bit depth conversion, no color space conversions (Adobe RGB throughout). Using a hardware calibrated Eizo, there's no banding in the display system - what I see on-screen is real.

I'm not surprised that the jpegs had color banding, I've seen that often enough. The two chroma components are more compressed than the luminance component, this is part of the jpeg algorithm.

But it was surprising that they were so different. The only explanation I can think of is that saving out from a 16 bit file uses the Export module in the background. But still I thought the basic engine was the same.

Posting jpegs here is a bit iffy - the browser's jpeg decoding might not be optimal. I might not see what you're seeing at your end.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

D Fosse wrote:

What I don't get here is your procedure. How do you change bit depth with or without dither? Yes, it's a checkbox in Color Settings, but what does that have to do with bit depth?

Simply draw a grey grad at 16bpc then click on Image>Mode and select 8 Bits/Channel.  How that 16bpc to 8bpc conversion is performed is dependent on the 'Use Dither' box in Color Settings Conversion Options.  If the box isn't ticked the conversion simply truncates 16 bits to 8 bits (strictly speaking I think it rounds rather than truncates).  If it is ticked the conversion is performed with dither, using the lower order bits to control the dither noise distribution.  In other words, the lower order bits still play a part in the rendering of the 8bpc image and are not simply thrown away.  With a nice Eizo monitor the difference should be immediately apparent.

Perhaps there could be a more logical place for that option, although it seems reasonable there to me.

Returning to the original point, when you save to JPEG from 16bpc, the dither does not get applied, even if this option box is checked.  Therefore, if this box is checked, you'll get a different JPEG output saving directly from 16bpc mode to that saving after conversion to 8bpc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

OK, I've tried again, this time with a monochrome gradient similar to yours. I saved out with and without dither checked in Color Settings, from 16 bit and 8 bit originals.

This time, I can not see any difference whatsoever, between any of the four jpegs. I clearly see the 8 bit steps of course, but they are all in the same position in all four. They are all perfectly identical.

BTW thanks for making me make these test gradients again, because I discovered that 10 bit display on the Eizo is now mysteriously working again. It didn't for a long time. Anyway, this takes the display system completely out of the equation.

So I think there's something else going on here.

How that 16bpc to 8bpc conversion is performed is dependent on the 'Use Dither' box in Color Settings Conversion Options. If the box isn't ticked the conversion simply truncates 16 bits to 8 bits (strictly speaking I think it rounds rather than truncates). If it is ticked the conversion is performed with dither, using the lower order bits to control the dither noise distribution.

Not to question what you're saying, just curious - but is this something you know for a fact, from other sources?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

Thanks for taking the time to check this for yourself.  I wonder why we're seeing it differently.  There must be a reason.  Some other setting somewhere?

I saved out with and without dither checked in Color Settings, from 16 bit and 8 bit originals.

Just checking but by that you don't mean you drew the grad in 8 bit mode? To observe the effect you must draw the grad in 16 bit mode, then switch to 8 bit mode through Image>Mode.  If dither isn't enabled in 'Color Settings' you will immediately see the 8 bit steps.  Hit Ctrl+Z to undo the 8 bits/channel conversion, enable dither and switch to 8 bit mode again.  When dither is enabled you will probably still be able to pick out the steps, but they will be a lot less obvious if they are dithered (less obvious than they are in 16 mode on an 8 bit monitor).  At least, that's what happens on my system.  There's no need to output any JPG files to test this, it will be observable on the screen. as you do it.

Also, as you have a 10 bit monitor, best do all this at a display zoom of 66.7% or higher.

Not to question what you're saying, just curious - but is this something you know for a fact, from other sources?

It's not something I've read about elsewhere, otherwise I wouldn't have brought it up. I'm just reporting the way I observe it working on my systems.

I'm running on a PC.  I don't know if there are any functional differences running a Mac.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

richardj21724418 wrote:

Just checking but by that you don't mean you drew the grad in 8 bit mode? To observe the effect you must draw the grad in 16 bit mode, then switch to 8 bit mode through Image>Mode.

Yes, that's how I did it.

I'm viewing everything at 100% consistently. And I'm on Windows.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

It's very weird. I can't find any other settings that might affect it.

I think my question is answered really, in that it hasn't been answered!  I guess if I have an image that might benefit from being dithered, then I need to convert to 8 bit before saving as JPG.  Not that it appears to work for everyone!

Thanks for looking at it anyway.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

LATEST

Ah, applying a levels adjustment to the images makes it vey obvious.  I should have done that to start with!

In 16-bit mode I drew a 97 to 103 grad and then did the 8-bit conversions. Then I applied a level adjustment with a range of 80 to 120 to all three images.  It's interesting that the steps in the non-dithered conversion aren't uniformly spaced, but lets not go there!  So one conversion is with the 'Use Dither' box in Color Settings unchecked, the other with it checked.  Saving a JPG file directly from 16-bit mode doesn't apply dither, regardless of the 'Use Dither' setting.

16-bit

16_bit_amp.jpg

Converted to 8-bit without dither (equivalent to saving JPG at 16-bit)

Converted_to_8_bit_no_dither_amp.jpg

Converted to 8-bit with dither (which can now be saved to JPG)

Converted_to_8_bit_with_dither_amp.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines