Color LUT and floating point

Discussion related to the LuxCore functionality, implementations and API.
daros
Posts: 163
Joined: Thu Dec 12, 2019 3:25 pm

Color LUT and floating point

Post by daros » Wed Aug 04, 2021 10:40 am

Hi, is it possible that when custom Lut is applied using Color LUT image pipeline, the resulting image is not floating point anymore?
Thanks

daros
Posts: 163
Joined: Thu Dec 12, 2019 3:25 pm

Re: Color LUT and floating point

Post by daros » Wed Aug 04, 2021 10:54 am

By the way we tried even using OCIO and the problem is the same... the resulting image is not floating point anymore.
Attachments
test curve.zip
(85.11 KiB) Downloaded 15 times

daros
Posts: 163
Joined: Thu Dec 12, 2019 3:25 pm

Re: Color LUT and floating point

Post by daros » Wed Aug 04, 2021 11:02 am

Linear
Linear_1.jpg

Linear -20% exp
Linear-20%exp_1.jpg

LUT applied (lut pipleine or ocio identical results)
lut_1.jpg

LUT applied - 20% ep
LUT-20%exp_1.jpg


The LUT - 20% exposure shows clearly that the bright area is completely flattered.

bartek_zgo
Posts: 81
Joined: Mon Oct 26, 2020 11:42 am

Re: Color LUT and floating point

Post by bartek_zgo » Wed Aug 04, 2021 11:13 am

We have checked 2 modes of applying lut files:
First:

Code: Select all

film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "INTEL_OIDN"
film.imagepipelines.0.1.prefilter.enable = "1"
film.imagepipelines.0.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.0.2.sensitivity = "100"
film.imagepipelines.0.2.exposure = 0.1
film.imagepipelines.0.2.fstop = 22
film.imagepipelines.0.3.type = "TONEMAP_LINEAR"
film.imagepipelines.0.3.scale = "0.39"
film.imagepipelines.0.4.type = "TONEMAP_OPENCOLORIO"
film.imagepipelines.0.4.mode = "LUT_CONVERSION"
film.imagepipelines.0.4.lutfile = "/mnt/z/Felix/Data/Configs/LutFiles/burn_v01.cube"
Second:

Code: Select all

film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "INTEL_OIDN"
film.imagepipelines.0.1.prefilter.enable = "1"
film.imagepipelines.0.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.0.2.sensitivity = "100"
film.imagepipelines.0.2.exposure = 0.1
film.imagepipelines.0.2.fstop = 22
film.imagepipelines.0.3.type = "TONEMAP_LINEAR"
film.imagepipelines.0.3.scale = "0.39"
film.imagepipelines.0.4.type = "COLOR_LUT"
film.imagepipelines.0.4.file = "/mnt/z/Felix/Data/Configs/LutFiles/burn_v01.cube"
film.imagepipelines.0.4.strength = "1.0"
The result is identical

daros
Posts: 163
Joined: Thu Dec 12, 2019 3:25 pm

Re: Color LUT and floating point

Post by daros » Thu Aug 05, 2021 8:04 am

Hi Dade, could you please help on this? This OCIO or LUT stuff is really impressive for us but if we are enot able to keep the bit depth it is useless. Thanks

User avatar
Dade
Developer
Posts: 5522
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Color LUT and floating point

Post by Dade » Thu Aug 05, 2021 9:36 am

I need the scene, the .zip includes only the .cube file.
Support LuxCoreRender project with salts and bounties

bartek_zgo
Posts: 81
Joined: Mon Oct 26, 2020 11:42 am

Re: Color LUT and floating point

Post by bartek_zgo » Thu Aug 05, 2021 1:33 pm

Here you are!
Attachments
luxScene.zip
(877.61 KiB) Downloaded 12 times

User avatar
Dade
Developer
Posts: 5522
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Color LUT and floating point

Post by Dade » Fri Aug 06, 2021 10:20 am

I'm unable to replicate your results.

This is an exposure 0.1 rendering without LUT:
i1.jpg

This is an exposure 0.06 rendering without LUT:
i2.jpg

This is an exposure 0.06 rendering with LUT:
i3.jpg

The last image is clearly different from your result.

The images where saved with:

Code: Select all

film.outputs.0.type = "RGB_IMAGEPIPELINE"
film.outputs.0.filename = img.jpg
Do you have problems displaying EXRs ? Because you were saving .exr instead of .jpg.
Support LuxCoreRender project with salts and bounties

bartek_zgo
Posts: 81
Joined: Mon Oct 26, 2020 11:42 am

Re: Color LUT and floating point

Post by bartek_zgo » Mon Aug 09, 2021 7:56 am

I think Dade we misunderstood. We are saving exr images. Why? Because they are 16-bit floating points. So let say that we obtain a burnt image like the first one in your last post. Than we open it with photoshop and change exposure. If we render without lut, it is working. We can recover burnt areas. If we add lut files, we can not recover them. If we will save output as jpg, we will not be able to recover any pixel that is white.
So I know that changing the exposure during render I can fix the image. But that is not the point. We want to recover render that is overexposed.

User avatar
Dade
Developer
Posts: 5522
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Color LUT and floating point

Post by Dade » Mon Aug 09, 2021 10:42 am

bartek_zgo wrote:
Mon Aug 09, 2021 7:56 am
We can recover burnt areas. If we add lut files, we can not recover them.
Yes, because LUT are expecting values between [0.0, 1.0], they are not defined outside that range. Because of this, the values are clamped between [0.0, 1.0]: https://github.com/LuxCoreRender/LuxCor ... ut.cpp#L80

The code linked above is my code but the proof it is correct is in the test with OpenColorIO: it produces exactly the same result (and it is written by other people).

It is your procedure to be wrong, you need to adjust exposure before LUT (like I did in my test above), not after. LUT expects values between 0.0 and 1.0 so you can use them only after tone mapping (i.e. exposure adjustment), not before.
Support LuxCoreRender project with salts and bounties

Post Reply