Dithering from 16 bit to 8 bit

Here everybody can post his problems with PhotoLine
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Dithering from 16 bit to 8 bit

Beitrag von Juan »

Hi all,

I have noticed a heavy dithering in my images when I convert them from 16 bit or 32 bit to 8 bit color depth. Is there a way to prevent this dithering?

Cheers,
Juan
Benutzeravatar
der_fotograf
Mitglied
Beiträge: 559
Registriert: Mo 05 Dez 2016 08:33

Re: Dithering from 16 bit to 8 bit

Beitrag von der_fotograf »

If you use this tool, you won't have any dithering:

Screen Shot 2020-09-01 at 16.52.34.png
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Nur wenige wissen, wie viel man wissen muss, um zu wissen, wie wenig man weiss.
Only few know how much you have to know to know how little you know.
— Werner Heisenberg [German theoretical physicist]
Benutzeravatar
Gerhard Huber
Entwickler
Entwickler
Beiträge: 4143
Registriert: Mo 18 Nov 2002 15:30
Wohnort: Bad Gögging

Re: Dithering from 16 bit to 8 bit

Beitrag von Gerhard Huber »

I think it depends on the setting of the antialias switch.
But without dithering, you will get banding. Be aware that quality of 8 Bit images is not so good as 16 or 32 bit.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Dithering from 16 bit to 8 bit

Beitrag von Juan »

der_fotograf hat geschrieben: Di 01 Sep 2020 16:56 If you use this tool, you won't have any dithering:


Screen Shot 2020-09-01 at 16.52.34.png
That's what I use and it give me the dithering.
Gerhard Huber hat geschrieben: Di 01 Sep 2020 17:05 I think it depends on the setting of the antialias switch.
But without dithering, you will get banding. Be aware that quality of 8 Bit images is not so good as 16 or 32 bit.
The problem is that I can't send to my customers a 16bit picture, since they are just plain people with paint and windows picture viewer installed only.

So before converting the picture to 8 bit should I deactivate anti-alias?
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Dithering from 16 bit to 8 bit

Beitrag von shijan »

I just checked few generated test gradients, converted from 16 to 8 bit in PrhotoLine and in other apps, and both look near the same. Both apps add some small amount of noise (dithering) to 8 bit image to avoid banding artefacts.
Can you provide your 16 bit source image?
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Dithering from 16 bit to 8 bit

Beitrag von Juan »

shijan hat geschrieben: Di 01 Sep 2020 17:44 I just checked few generated test gradients, converted from 16 to 8 bit in PrhotoLine and in other apps, and both look near the same. Both apps add some small amount of noise (dithering) to 8 bit image to avoid banding artefacts.
Can you provide your 16 bit source image?
Thank you for checking it with other programs. Sadly, this current project is under NDA and I can't share anything yet. I guess when I deliver it I will ask the client if I can share it.

It could be that since the image has a little bit of noise, this gets "overhauled" by the dithering?
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Dithering from 16 bit to 8 bit

Beitrag von shijan »

You may just crop small part where you see dithering. Or do a PNG screenshot of zoomed part before and after bit depth transform. No one just can't tell you any solution without seeing actual example of problem. Maybe it is not a dithering but something else...
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Dithering from 16 bit to 8 bit

Beitrag von shijan »

By the way, dinthering and banding may be just due color management on your system or due display calibration ICC profile, at least due image ICC profile itself. Try to inspect final exported image in different viewer, different system or different monitor...
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
der_fotograf
Mitglied
Beiträge: 559
Registriert: Mo 05 Dez 2016 08:33

Re: Dithering from 16 bit to 8 bit

Beitrag von der_fotograf »

The »Antialias« settings are kind of confusing. You can enable the antialias in the panel, but in the »Document« settings it still is set to »Default«.

Screen Shot 2020-09-01 at 18.57.19.png
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Nur wenige wissen, wie viel man wissen muss, um zu wissen, wie wenig man weiss.
Only few know how much you have to know to know how little you know.
— Werner Heisenberg [German theoretical physicist]
Juan
Mitglied
Beiträge: 611
Registriert: Do 06 Okt 2011 08:08

Re: Dithering from 16 bit to 8 bit

Beitrag von Juan »

Thank you all for pitching it here :D

I tried many combinations with no avail.

Here is a really tiny piece of the image in 16bit, I hope that there is a missing thing in my workflow so I can fix it.
https://1drv.ms/u/s!AoMv8bCdXlOdxj-KZS3 ... f?e=rUAYuD

Cheers,
Juan
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2140
Registriert: Sa 12 Mai 2012 21:38

Re: Dithering from 16 bit to 8 bit

Beitrag von Herbert123 »

That is a rendered image, correct? The dark areas contain a lot of noise. Before converting to a lower bit depth, I would suggest rendering either more samples or using the built-in denoiser in your 3d app, or both.

As it stands, there is just too much noise in the shadows in that render. It is going to throw off conversions later on in the pipeline.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2140
Registriert: Sa 12 Mai 2012 21:38

Re: Dithering from 16 bit to 8 bit

Beitrag von Herbert123 »

Update.

I opened your EXR in Blender's compositor, denoised it, and saved it. Opened in PhotoLine, and converted to 8bit.

It was a tad surprising: no matter whether I converted with or without anti-aliasing, the result was pretty terrible. Very noisy and awful dithering in the dark wood. It does not matter if I turn anti-aliasing on or off.

To double-check, I used Blender to save a 8bit and 16 bit PNG. The result: visible noise due to rendering as expected in the shadows, but it is acceptable as a whole.

It seems PhotoLine interprets this file wrong, and adds a humongous amount of unnecessary dithering. Even the denoised 32bit exr version from Blender gets mangled by extreme dithering. Again: it does not matter if anti-aliasing is active or not.

I think this is a bug. When I use the Web Export option, the EXR 32bit image looks as expected when I pick PNG output. Even an 8bit 256 colour version looks much better than the 24bit converted version in the viewport! This really must some sort of bug.

And one other thing that I noticed: when opening the file in PhotoLine, and switching off anti-aliasing, the grey border area displayed slightly visible blocks. When I turn on anti-aliasing, the grey border area is dithered! (my picture mode edge area colour is set to #5e5e5e)
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2140
Registriert: Sa 12 Mai 2012 21:38

Re: Dithering from 16 bit to 8 bit

Beitrag von Herbert123 »

Workaround for now: export your 16/32bit EXR as a PNG file via Web Export. This generates a usable 8bit conversion. Do not reduce the bit depth in the Layer properties to 8bit, and continue to work in either 32bit or 16 bit.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Dithering from 16 bit to 8 bit

Beitrag von shijan »

Formally It is a bug. But usually it is not recommended to convert from 32 bit linear directly to 8 bit gamma corrected. And i have no technical background to explain why.

Here is how convert 100% without artifacts:
Step 1.
- Open Tool -> Color -> Convert with Color Profile
- do not change color space (select original sRGB or other color space that you used)
- Uncheck "Linear Brigthness (Gamma 1.0)" (this will convert linear gamma to normal sRGB gamma)

Step 2.
Do Bit depth convert from 32 to 8 bit.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Dithering from 16 bit to 8 bit

Beitrag von shijan »

Another suggest - just render directly to gamma corrected image to 16 bit Tiff file and use tone mapping in render settings. But not all renders have proper tone mapping option.

Render to EXR in linear gamma without tone mapping require some proper color space transform and tone mapping post processing workflow to make image look pretty. EXR use sRGB color space as default, but because it is 32 bit float with linear gamma it formally compress infinity amount of all possible source color data from render to sRGB coordinates, and you can unpack that wide gamut color data back to any desired color space.
You can do it in DaVinci Resolve/Nuke or any other similar app that operates in 32 bit float and provides adjustable tone mapping and color space compression tools.

Check part of this workflow tutorial here. It explains how to adjust phisically based Exposure in non RAW files.
https://forum.blackmagicdesign.com/view ... 25#p537852
Bild
Bild
Bild
Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302