Dithering from 16 bit to 8 bit

Here everybody can post his problems with PhotoLine
User avatar
shijan
Mitglied
Posts: 360
Joined: Mon 23 Dec 2019 15:21

Re: Dithering from 16 bit to 8 bit

Post by shijan » Wed 02 Sep 2020 01:20

Seems not a bug. Everything works as expected. 8 bit just not enough to represent smooth tonal data in linear gamma. You will see ugly pixel noise in any 8 bit image with linear gamma.

- When you use Web Export image always TRANSFORMS from document color space/gamma/bit depth to sRGB color space/gamma and 8 bit depth.

- But when you simply change bit depth in document or image settings, you don't change gamma or color space. You change only bit depth.

Linear gamma ONLY for 32 or 16 bit images.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302

bruce1951
Mitglied
Posts: 341
Joined: Sat 23 Apr 2016 17:03

Re: Dithering from 16 bit to 8 bit

Post by bruce1951 » Wed 02 Sep 2020 06:16

I've been following along. Dumb question!! How relevant is PPI?

Juan
Mitglied
Posts: 596
Joined: Thu 06 Oct 2011 08:08

Re: Dithering from 16 bit to 8 bit

Post by Juan » Wed 02 Sep 2020 08:16

Herbert123 wrote:
Tue 01 Sep 2020 22:25
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.
This helped a lot, thank you for the workaround. :idea:
shijan wrote:
Wed 02 Sep 2020 00:04
Check part of this workflow tutorial here. It explains how to adjust phisically based Exposure in non RAW files.
That´s a must for me to read. I will follow your suggestions as well. :)


Maybe the developers can pitch in to confirm if there is a bug or not.

Thank you all for the comments, at least for now since I have to deliver this now, the quick workaround did the trick.

Cheers,
Juan

User avatar
shijan
Mitglied
Posts: 360
Joined: Mon 23 Dec 2019 15:21

Re: Dithering from 16 bit to 8 bit

Post by shijan » Wed 02 Sep 2020 17:36

Pros of Linear Gamma:
- Linear gamma is perfect for EXR export from 3D apps renders, because it behaves like some sort of seni-RAW file that contains all possible wide colors and all possible high dynamic tonal range existed in 3D scene.
- Linear gamma is perfect for film negative scanning, because it behaves like some sort of semi-RAW file and contains all possible wide colors and all possible high dynamic tonal range. See some info here https://www.pl32.com/forum3/viewtopic.p ... =15#p46765
- Linear gamma is perfect for image resize. See some tests here https://www.pl32.com/forum3/viewtopic.p ... =75#p46871
- Linear gamma is perfect for color space transformations, because it never produce color casts.
- Linear gamma is perfect for White Balance adjustments. RGB gain in Linear gamma is equal to White Balance in RAW (with some limitations due bit depth). See some tests and workflow explanation here https://forum.blackmagicdesign.com/view ... 2&t=114403
- Linear gamma is perfect for Exposure adjustments. Gain adjusted in Linear gamma is equal to physically correct Exposure adjusted in RAW. See some tests and workflow explanation here https://forum.blackmagicdesign.com/view ... 25#p537852
- Linear gamma may produce very nice, physically correct look with some blending modes and fades.

Cons of Linear Gamma:
- Require 32 or 16 bit depth. Always will produce posterization artifacts in 8 bit.
- Not usable for most normal color correction tools. Curves and contrast adjustments behave rough, invert looks strange, and so on...
- Not usable for web delivery or basic preview for client.

Overall Linear gamma is sort of unique tool that works well in some specific situations. Just make sure you understand how convert to linear gamma and back for some specific tasks and how it interact with image ICC profile and the rest of color management.

PhotoLine tools options for Linear gamma are not too extended. You can do to/from linear gamma transformations in "Convert with Color Profile" tool. And you also have gamma function slider in some tools (i didn't test it, but probably it should work like real gamma correction because PhotoLine tools can operate internally in 32 bit float.
Also in last versions of PhotoLine you can use custom generated high precision 1D LUTs for quick non destructive gamma transformations from/to. Free tools like LUTCalc https://cameramanben.github.io/LUTCalc/ ... index.html allow to generate 1D LUTs with up to 16384 point precision.

Note that Adobe Protoshop gamma correction slider in Levels/Exposure tool is useless for real gamma transformation. It is a fake simplified tool that operates in reduced bit depth and have nothing to real gamma transformation math.

Seems PhotoLine really lack of some proper gamma/color space mapping Adjustment layer tool to deal in one click with linear EXR files from 3D renders. Something similar to ColorSpace Transform Node with Saturation and Luma mapping sliders in Davinci Resolve.
You do not have the required permissions to view the files attached to this post.
Last edited by shijan on Wed 02 Sep 2020 21:23, edited 4 times in total.
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302

Martin Huber
Entwickler
Entwickler
Posts: 3654
Joined: Tue 19 Nov 2002 15:49

Re: Dithering from 16 bit to 8 bit

Post by Martin Huber » Wed 02 Sep 2020 18:25

Juan wrote:
Wed 02 Sep 2020 08:16
Maybe the developers can pitch in to confirm if there is a bug or not.
It's not a bug.

As shijan wrote, the main problem is the linear color space.
If you convert gradients or gradient like structures from 16/32 bit to 8 bit in linear colorspace, you will either get visible dithering or really bad banding.

So before converting to 8 bit, convert to a color space with a gamma of 2.2 or 1.8 (for viewing purposes, sRGB is well-suited which has a gamma of about 2.2). "Web Export" does that implicitily.

"Convert Layer Type" (that's what the Layer Attributes are using) has a small bug, though. It ignores the antialiasing setting and dithers always. I will fix that.

Martin

Martin Huber
Entwickler
Entwickler
Posts: 3654
Joined: Tue 19 Nov 2002 15:49

Re: Dithering from 16 bit to 8 bit

Post by Martin Huber » Wed 02 Sep 2020 18:29

der_fotograf wrote:
Tue 01 Sep 2020 19:00
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«.
If the document setting is "Default", the document uses the global settiing. The global setting is the button in the iconbar or "Edit > Antialias".

Martin

User avatar
Herbert123
Mitglied
Posts: 1919
Joined: Sat 12 May 2012 21:38

Re: Dithering from 16 bit to 8 bit

Post by Herbert123 » Wed 02 Sep 2020 20:58

Thanks Martin and Shijan for the clarifications!
/*---------------------------------------------*/
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

User avatar
der_fotograf
Mitglied
Posts: 360
Joined: Mon 05 Dec 2016 08:33

Re: Dithering from 16 bit to 8 bit

Post by der_fotograf » Thu 03 Sep 2020 07:56

If the document setting is "Default", the document uses the global settiing. The global setting is the button in the iconbar or "Edit > Antialias".
Thanks Martin, I've checked it and noticed that the global setting is »Antialias«. BTW, I can not see any difference on the screen if switching back and forth... at least with 120 MP files. Maybe it's more visible in lower res files?
--------------------------------------------
Nur wenige wissen, wie viel man wissen muss, um zu wissen, wie wenig man weiss.
— Werner Heisenberg

Martin Huber
Entwickler
Entwickler
Posts: 3654
Joined: Tue 19 Nov 2002 15:49

Re: Dithering from 16 bit to 8 bit

Post by Martin Huber » Thu 03 Sep 2020 10:54

der_fotograf wrote:
Thu 03 Sep 2020 07:56
BTW, I can not see any difference on the screen if switching back and forth... at least with 120 MP files. Maybe it's more visible in lower res files?
With image editing, the differences are barely visible.

They are mostly visible in linear colorspace and in combination with vector graphics/text.

Martin