exr image output

Discussion related to the LuxCore functionality, implementations and API.
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

exr image output

Post by bartek_zgo »

Hi,
I have a problem saving images as exr. They look to have a strange gamma. First I made render with png and gamma 2.2. I have flowing pipeline
film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "NOP"
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 = "GAMMA_CORRECTION"
film.imagepipelines.0.3.value = "2.2"
film.outputs.0.type = "RGB_IMAGEPIPELINE"
film.outputs.0.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\1_FI_68995_272448_0000.png"

Than I've changed extension to exr:
gamma2_2.png
As you can see the colors are washed out. This is because I have gamma 2.2 in exr and than XnView apply again gamma 2.2

So I remove gamma correction from XnView and get correct image:
gamma2_2_bis.png
But this is not in 100% correct. Exr images should be saved with gamma 1.0, because all software (XnView, Gimp, Photoshop) apply 2.2 gamma correction to exr images. So logical solution is set 1.0 to gamma correction in image pipeline. But I get something strange:
gamma1_0.png
Could somebody explain to what I'm doing wrong? From my point of view, id should identical if I apply gamma correction during save process or read process as long as I apply it only once.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: exr image output

Post by Dade »

bartek_zgo wrote: Tue Nov 17, 2020 1:20 pm Could somebody explain to what I'm doing wrong?
I assume you want to have 2 image pipelines, one with gamma correction (likely for screen update) and one without for .exr saving. Something along the line of:

Code: Select all

film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "NOP"
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 = "GAMMA_CORRECTION"
film.imagepipelines.0.3.value = "2.2"
##
film.imagepipelines.1.0.type = "NOP"
film.imagepipelines.1.1.type = "NOP"
film.imagepipelines.1.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.1.2.sensitivity = "100"
film.imagepipelines.1.2.exposure = 0.1
film.imagepipelines.1.2.fstop = 22
##
film.outputs.0.type = "RGB_IMAGEPIPELINE"
film.outputs.0.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\1_FI_68995_272448_0000.png"
# The index of the image pipeline to save
film.outputs.0.index = 1
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: exr image output

Post by bartek_zgo »

I have one image pipeline and I have started render twice. So I've changed the value of gamma corection. I put 1.0. I can try to remove it from pipeline but it should be the same.
film.imagepipelines.0.3.type = "GAMMA_CORRECTION"
film.imagepipelines.0.3.value = "1.0"
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: exr image output

Post by Dade »

bartek_zgo wrote: Tue Nov 17, 2020 3:10 pm I have one image pipeline and I have started render twice. So I've changed the value of gamma corection. I put 1.0. I can try to remove it from pipeline but it should be the same.
film.imagepipelines.0.3.type = "GAMMA_CORRECTION"
film.imagepipelines.0.3.value = "1.0"
Sorry ?

Like I wrote, define 2 image pipelines (you can have any number of image pipelines at the same) and use the one appropriate for the task you want perform.
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: exr image output

Post by bartek_zgo »

I started render twice just for test. I don't need png with gamma 2.2. I only need exr with gamma 1.0. I know that I can define many pipelines but I want only one
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: exr image output

Post by Dade »

bartek_zgo wrote: Tue Nov 17, 2020 3:20 pm I started render twice just for test. I don't need png with gamma 2.2. I only need exr with gamma 1.0. I know that I can define many pipelines but I want only one
If you want 2 types of outputs, one with gamma 2.2, one with gamma 1.0, you must define 2 image pipelines. Image pipelines don't have a cost so why exactly can't you use this solution ?
Support LuxCoreRender project with salts and bounties
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: exr image output

Post by Sharlybg »

Dade wrote: Tue Nov 17, 2020 3:31 pm
bartek_zgo wrote: Tue Nov 17, 2020 3:20 pm I started render twice just for test. I don't need png with gamma 2.2. I only need exr with gamma 1.0. I know that I can define many pipelines but I want only one
If you want 2 types of outputs, one with gamma 2.2, one with gamma 1.0, you must define 2 image pipelines. Image pipelines don't have a cost so why exactly can't you use this solution ?
He is expecting to have same look for the render no matter he save it in EXR or PNG.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: exr image output

Post by Dade »

Sharlybg wrote: Tue Nov 17, 2020 3:34 pm He is expecting to have same look for the render no matter he save it in EXR or PNG.
And it is a request that doesn't make sense because applications expect to have EXR files with gamma 1.0 and PNG with gamma 2.2.
Support LuxCoreRender project with salts and bounties
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: exr image output

Post by bartek_zgo »

Dade wrote: Tue Nov 17, 2020 3:48 pm And it is a request that doesn't make sense because applications expect to have EXR files with gamma 1.0 and PNG with gamma 2.2.
Yes. This is what I want. Exr with gamma 1.0. All programs (by default) apply gamma correction 2.2 to exr. So the image should look identical (png and exr saved with gamma 1.0 with gamma correction 2.2 applied by viewing software)
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: exr image output

Post by bartek_zgo »

I have defined multi pipelines as you asked.

Code: Select all

film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "NOP"
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 = "GAMMA_CORRECTION"
film.imagepipelines.0.3.value = "1.0"
film.outputs.0.type = "RGB_IMAGEPIPELINE"
film.outputs.0.index = 0
film.outputs.0.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\rgb.png"
film.outputs.1.type = "RGB_IMAGEPIPELINE"
film.outputs.1.index = 0
film.outputs.1.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\rgb.exr"

film.imagepipelines.1.0.type = "NOP"
film.imagepipelines.1.1.type = "NOP"
film.imagepipelines.1.2.type = "TONEMAP_LUXLINEAR"
film.imagepipelines.1.2.sensitivity = "100"
film.imagepipelines.1.2.exposure = 0.1
film.imagepipelines.1.2.fstop = 22
film.imagepipelines.1.3.type = "GAMMA_CORRECTION"
film.imagepipelines.1.3.value = "2.2"
film.outputs.2.type = "RGB_IMAGEPIPELINE"
film.outputs.2.index = 1
film.outputs.2.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\rgb_g22.png"
film.outputs.3.type = "RGB_IMAGEPIPELINE"
film.outputs.3.index = 1
film.outputs.3.filename = "c:\Bartek\stack\LuxCoreTests\exrGammaProblems\rgb_g22.exr"
So the image rgb_g22.png is my reference one. This is how the render should look like.
Than I have 2 exr files. One with gamma 1.0 another with gamma 2.2. If if open them with gimp neither of them lool like png file, but they should.
I mean. The exr with gamma 2.2 will not be correct, as gimp applies gamma correction 2.2 wile opening exr files. So in this case we have to times 2.2 gamma applied. But with rgb.exr (that has gamma 1.0) opened with gimp that applies gamma correction 2.2 I should see exactly the same result as rgb_g22.png.
I can not attach exr files so I send screens of this files opened with gimp.
Attachments
rgb.png
rgb_g22.png
rgb.png
rgb_g22.png
Post Reply