16 bit v 8 bit question

Here everybody can post his problems with PhotoLine
bruce1951
Mitglied
Beiträge: 413
Registriert: Sa 23 Apr 2016 17:03

16 bit v 8 bit question

Beitrag von bruce1951 »

I load a 16 bit tiff into PL. I duplicate to make a new layer. The top 'new' layer I change to 8 bit. I make a radical curves modification to the new 8 bit, top, layer. (It could be any modification). I then flatten or merge down to again make just a single layer. The resulting layer is 16 bit but has kept the modifications made to the 8 bit layer.

So could someone help explain the theory behind what is happening? Why does it stay 16 bit rather than 8 bit. And why does the 16 bit layer adopt the modifications to the 8 bit layer?

The reason I'm asking is - I have a plugin that only accepts 8 bit files. I want to send an 8 bit layer to that plugin, modify it and send it back to PL. Then I want to merge the original 16 bit layer with the 8 bit, modified, layer. But I find the end result is always the same as the modified 8 bit layer. I was expecting a 'blend' of the 16 and 8 bit layers. So has the 16 bit layer now only got the data of the modified 8 bit layer? Or has it still got all the data of the 16 bit layer with the modifications applied from the 8 bit layer?

This is not an 'important' question, just one to satisfy my curiosity as to how 16 bit and 8 bit is working in PL. Is the 8 bit layer really converting back to 16 bit? Wouldn't the 16 to 8 bit conversion loose data and that data not ever come back when converted back to 16 bit?
I just like to learn how the logic is working behind the scenes.
:shock:
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: 16 bit v 8 bit question

Beitrag von shijan »

Are you work in Document mode or in Picture mode? Bit depth in PhotoLine transforms similar to color spaces.
In document mode filters applied at the top of any layer as stack, use document bit depth. So your 8 bit intermediate layer is virtually always up-scaled to 16 bit for processing if Document set to 16 bit.
This is nice because for example for you may have 8 bit image source, set Document to 32 bit and process things in 32 bit without increasing PLD file size because image source will remain in 8 bit. Some examples described here https://www.pl32.com/forum3/viewtopic.p ... =45#p46806

In Picture mode filters stacked on top always use bit depth of bottom Background image layer. So your 8 bit intermediate layer is virtually always up-scaled to 16 bit for processing if bottom Background layer is set to 16 bit.

Filters placed directly inside image layer use bit depth of that image. So if you apply filter inside 8 bit layer, it it will be processed only in 8 bit.

This is how you can check bit depth in real life in your workflow:
- Create test grey gradient in 8 or in 16 bit
- Convert vector gradient to image.
- Apply strong Levels clipping to it.

If you see clean gradient it means everything is in 16 bit.
If you see pixelated dithered gradient, it means that image source or processing is 8 bit.
Based on same method i done a lot of codec and filters bit depth tests in video editing apps here https://forum.selur.net/showthread.php?tid=1288
Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
bruce1951
Mitglied
Beiträge: 413
Registriert: Sa 23 Apr 2016 17:03

Re: 16 bit v 8 bit question

Beitrag von bruce1951 »

Thanks shijan. I work in Picture mode. The Background layer is always 16 bit when I start a new project.

Most of my work is 'artistic'. So in reality 16 or 8 bit doesn't matter for the output I'm after. I was curious as to how PL worked. I just need to be aware of what results I get from each step I take.

regards