1
$\begingroup$

I noticed that I'm loosing colour information in the highlights after exporting and importing pngs from Blender. I know that the compositor works with linear space but something gets lost when saving to png.

Here is what I do:

  • Render my image and look at it in compositor, all highlights preserved
  • Save the image as png and look at the png with an image viewer, all highlights preserved
  • Use an Image node in compositor and look at png, highlights lost
  • Safe the image from the node to png, highlights still lost

So there is something going on while importing/reading the file. I have checked "View as Render" in the image nodes properties. I use Blender 2.90.0

Any ideas?

$\endgroup$
1
  • $\begingroup$ Are you saving png with an alpha layer ? $\endgroup$
    – Gorgious
    Commented Oct 29, 2020 at 13:56

1 Answer 1

3
$\begingroup$

Never use png, it is not a good format to store images that are meant for compositing or further manipulation, plus is a format that does not deal with alpha channels correctly.

Use EXR. Think of EXR as a way to save your render layers intact, as blender generated them.

The compositor does works using scene referred, unlimited linear data (there is no such thing as "linar space"). If you want to save images to be composited later or do any kind of post processing you need to keep the rendered images as scene referred, comopositing operations work better if the data is in a linear scale.

PNG is a display referred format, not only has a limit in the sense that it cannot store values larger than 1, but most likely the image information has gone through a display transform, set in the color management section of blender, which applies a transfer function (also known as a "gamma curve"), so the data is no longer linear.

If you "must" use png, or any other display referred format, that has an image that is meant to be viewed as sRGB, then you need to set the color management view to sRGB when you import it back to blender, so that it is interpreted correctly using "view as rendered. Otherwise the information will be processed using "filmic", which is the default color transform.

Images displayed in a different color space will always look wrong

Another way to understand the issue:

When you import an image into the compositor, you have to let blender know what kind of color space the image is using, so that blender applies an inverse view transform to "linarize" the data, then that it can be composited correctly. If the data comes from images in display referred formats, and the color space in blender is set to filmic, then the values are too low, and what used to be white in the picture(1) will only be gray, as filmic expects much larger values for white (aproximately 16.19). If you set the view transform to sRGB, then white will be set to 1 again...

read:

Render with a wider dynamic range in cycles to produce photorealistic looking images

and

Why We Bother With Linear and Nonlinear Encodings At All?

$\endgroup$
2
  • $\begingroup$ Ah wow, its very confusing to me that color management in in the render settings tab and still effects the compositor. Thanks for making things clear to me, i will need to use .exr in the future or keep in mind to switch color management when doing png stuff $\endgroup$ Commented Oct 29, 2020 at 20:37
  • 1
    $\begingroup$ Color management is meant to be able to control all output (3d, compositor and the terrible VSE). The only output that by design skips all color transforms is EXR. $\endgroup$
    – susu
    Commented Oct 29, 2020 at 22:48

Not the answer you're looking for? Browse other questions tagged .