Blender OCIO ACES 1.2 Texture ColorTransform ignored - works in Compositor #76680

Open
opened 2020-05-12 13:57:55 +02:00 by Daniel Brylka · 15 comments

MBP 15" (2018)
Operating system: MACOS 10.5.4 Catalina
Graphics card: Radeon Pro 560X
Blender Version

Broken: Version 2.82a, 2.83 beta and 2.90 alpha (12th of May2020)

Short description of error
I setup up Blender according my little how-to on my website
https://www.toodee.de/?page_id=1720
The ACES IDT sRGB texture is taking off the sRGB (gamma), linearizes the texture and maps the sRGB gamut into the ACEScg gamut.
A JPG/PNG 8-Bit Texture File with a value of 1 will map it to 1.0 in scene linear.
To see a texture in ACES like it looked like in Photoshop for example you need to use the inverse RRT&ODT view transform. The IDT you choose is then Output_sRGB. This maps a texture value of 1 to 16.xxx in scene linear.
I am aware that this is the wrong method to use textures in ACES - this is a regular mistake when working with ACES and I wanted to write an article about it on my website and clarify the problem.

The Blender Compositor is actually working as expected. In the demo scene I use the texture two times with different IDTs (sRGB-Texture and OutPut sRGB - for comparison I also added the same texture as an EXR file.
Please check the Compositor and plug one or the other image to the gain 10% color correction to show the high scene linear values.

In the Shading tab I have the image texture window sized big and select the different image texture (2x JPG with two IDTs selected and one EXR file) - use right click to sample the texture values in the image view.
Only the EXR file shows actually higher values than one. Both JPG textures with the two IDTs selected are clipping at 1.0.
Blender_282_OCIO_Texture_ColorTransform_bug.blend.zip

MBP 15" (2018) Operating system: MACOS 10.5.4 Catalina Graphics card: Radeon Pro 560X **Blender Version** Broken: Version 2.82a, 2.83 beta and 2.90 alpha (12th of May2020) **Short description of error** I setup up Blender according my little how-to on my website https://www.toodee.de/?page_id=1720 The ACES IDT sRGB texture is taking off the sRGB (gamma), linearizes the texture and maps the sRGB gamut into the ACEScg gamut. A JPG/PNG 8-Bit Texture File with a value of 1 will map it to 1.0 in scene linear. To see a texture in ACES like it looked like in Photoshop for example you need to use the inverse RRT&ODT view transform. The IDT you choose is then Output_sRGB. This maps a texture value of 1 to 16.xxx in scene linear. I am aware that this is the wrong method to use textures in ACES - this is a regular mistake when working with ACES and I wanted to write an article about it on my website and clarify the problem. The Blender Compositor is actually working as expected. In the demo scene I use the texture two times with different IDTs (sRGB-Texture and OutPut sRGB - for comparison I also added the same texture as an EXR file. Please check the Compositor and plug one or the other image to the gain 10% color correction to show the high scene linear values. In the Shading tab I have the image texture window sized big and select the different image texture (2x JPG with two IDTs selected and one EXR file) - use right click to sample the texture values in the image view. Only the EXR file shows actually higher values than one. Both JPG textures with the two IDTs selected are clipping at 1.0. [Blender_282_OCIO_Texture_ColorTransform_bug.blend.zip](https://archive.blender.org/developer/F8530557/Blender_282_OCIO_Texture_ColorTransform_bug.blend.zip)
Author

Added subscriber: @DanielBrylka

Added subscriber: @DanielBrylka
Member

Added subscribers: @troy_s, @EAW

Added subscribers: @troy_s, @EAW
Member

Checking. @troy_s requesting you eyes on this since you know the most about where Blender currently fails to use OCIO for color management.

Checking. @troy_s requesting you eyes on this since you know the most about where Blender currently fails to use OCIO for color management.

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

This is a known issue. Textures in Blender will be stored in 8bit memory if the source file is 8bit, to keep memory usage predictable.

We can implement a way to detect transforms like this where this does not work well and values higher than 1.0 need to be represented, and switch to half float then.

This is a known issue. Textures in Blender will be stored in 8bit memory if the source file is 8bit, to keep memory usage predictable. We can implement a way to detect transforms like this where this does not work well and values higher than 1.0 need to be represented, and switch to half float then.

Only thing I'd add to @brecht's comment is that 8 bit textures are always woeful.

Why? Because they are compressed according to exactly one "idealized" emission from a display. That is, if you take that assumption into a path tracing / light transport system, that assumption falls apart. Change exposure by a single stop and you've pushed the result into the middle of a posterized set of values according to the compression.

There are two classes of imagery here:

  1. Normalized albedo, representing portions of a whole from 0% to 100% and the meaning is derived from that "whole" range.
  2. Emissions, from extremely low to extremely large values, where meaning is derived from the ratios between values.

Lower bit depth can represent both, with proper pixel management handling, but will always be subject to the issues noted above regarding 8 bit.

Only thing I'd add to @brecht's comment is that 8 bit textures are *always* woeful. Why? Because they are compressed according to exactly one "idealized" emission from a display. That is, if you take that assumption into a path tracing / light transport system, that assumption falls apart. Change exposure by a single stop and you've pushed the result into the middle of a posterized set of values according to the compression. There are two classes of imagery here: 1. Normalized albedo, representing portions of a whole from 0% to 100% and the meaning is derived from that "whole" range. 2. Emissions, from extremely low to extremely large values, where meaning is derived from the ratios between values. Lower bit depth can represent both, with proper pixel management handling, but will always be subject to the issues noted above regarding 8 bit.
Author

I guess colorspace transforms should to be handled in floating point precision anyways?

I guess colorspace transforms should to be handled in floating point precision anyways?

They do and are. I believe the issue here is GPU concerns.

It might be wise to assert that the transforms work properly, even if at an inappropriate depth, than not. This issue would appear only to individuals and pipes that are aware how to negotiate it and what causes it.

They do and are. I believe the issue here is GPU concerns. It might be wise to assert that the transforms work properly, even if at an inappropriate depth, than not. This issue would appear only to individuals and pipes that are aware how to negotiate it and what causes it.

Added subscriber: @pauanyu_blender

Added subscriber: @pauanyu_blender

I think I just ran into this issue... but I want to confirm if it's the same.

I imported this image file into Blender:

Expected.jpg

I am using ACES 1.2 from this repository, and I set the image color space to Output - sRGB.

The texture should look identical to the original image, and I confirmed that it is identical in ociodisplay.

However, in Blender it looks terrible, there is a lot of clipping and saturation problems:

Result.png

I run into this problem with quite a few images, it seems to happen especially with lighter skin tones.

I attached a .blend test file. Is this problem caused by the 8-bit clipping, or is it something else?

P.S. I am aware that you are normally supposed to import textures with Utility - sRGB - Texture, however in some rare cases it is correct to use Output - sRGB.

ACES Test.blend

I think I just ran into this issue... but I want to confirm if it's the same. I imported this image file into Blender: ![Expected.jpg](https://archive.blender.org/developer/F10677146/Expected.jpg) I am using ACES 1.2 [from this repository](https://github.com/colour-science/OpenColorIO-Configs), and I set the image color space to `Output - sRGB`. The texture *should* look identical to the original image, and I confirmed that it *is* identical in `ociodisplay`. However, in Blender it looks terrible, there is a lot of clipping and saturation problems: ![Result.png](https://archive.blender.org/developer/F10677134/Result.png) I run into this problem with quite a few images, it seems to happen especially with lighter skin tones. I attached a `.blend` test file. Is this problem caused by the 8-bit clipping, or is it something else? P.S. I am aware that you are normally supposed to import textures with `Utility - sRGB - Texture`, however in some rare cases it is correct to use `Output - sRGB`. [ACES Test.blend](https://archive.blender.org/developer/F10677160/ACES_Test.blend)
Author

I just tried your file out in Blender 3.00 alpha with ACES 1.2 from the same origin and the I can confirm that it still the same issue.

An 8-Bit JPG file shows this behavior, regardless of its image content.

You can work around this issue by converting your 8-Bit JPG file to a 16-Bit Tiff for example.
Blender seems to recognize the 16-bit file and the color transforms work as expected.
Still these kinds of color transforms should happen in floating point precision.

snap3.jpg

snap2.jpg

snap1.jpg

I just tried your file out in Blender 3.00 alpha with ACES 1.2 from the same origin and the I can confirm that it still the same issue. An 8-Bit JPG file shows this behavior, regardless of its image content. You can work around this issue by converting your 8-Bit JPG file to a 16-Bit Tiff for example. Blender seems to recognize the 16-bit file and the color transforms work as expected. Still these kinds of color transforms should happen in floating point precision. ![snap3.jpg](https://archive.blender.org/developer/F10687416/snap3.jpg) ![snap2.jpg](https://archive.blender.org/developer/F10687415/snap2.jpg) ![snap1.jpg](https://archive.blender.org/developer/F10687414/snap1.jpg)

@DanielBrylka Thanks, I also confirmed that using EXR textures works in Blender 2.93.2, so it is the same 8-bit clipping bug.

@DanielBrylka Thanks, I also confirmed that using EXR textures works in Blender 2.93.2, so it is the same 8-bit clipping bug.

I did some more experiments. Blender supports 7 different image formats which are 16-bit.

Using EXR doesn't work very well because you must convert the image from gamma to linear, so it only works if the image is already EXR to begin with.

I think the best option is to use 16-bit PNG. This gives identical results as TIFF, but with far smaller file sizes.

It's very easy to use GIMP to convert an existing image into 16-bit PNG:

  1. Open the image in GIMP
  2. Select Image -> Precision -> 16 bit integer
  3. Leave the Gamma as Perceptual gamma (sRGB)
  4. Click Convert
  5. File -> Export As... and save the image as .png

This is a decent workaround until this bug is fixed.

I did some more experiments. Blender supports [7 different image formats which are 16-bit](https://docs.blender.org/manual/en/latest/files/media/image_formats.html). Using EXR doesn't work very well because you must convert the image from gamma to linear, so it only works if the image is already EXR to begin with. I think the best option is to use 16-bit PNG. This gives identical results as TIFF, but with *far* smaller file sizes. It's very easy to use GIMP to convert an existing image into 16-bit PNG: 1. Open the image in GIMP 2. Select `Image` -> `Precision` -> `16 bit integer` 3. Leave the `Gamma` as `Perceptual gamma (sRGB)` 4. Click `Convert` 5. `File` -> `Export As...` and save the image as `.png` This is a decent workaround until this bug is fixed.
Author

Hi Pauan,

please check this link about TIFF vs. PNG.
https://twitter.com/andrewpprice/status/1440498403633291274?s=12

TIFF should be the better option for the work around until the issue is fixed.
Autodesk Flame has an image processing node where you can change the bit-depth of every source.
A simple checkbox in the texture image node in Blender could promote an 8-bit buffer to float if you click on it.

Hi Pauan, please check this link about TIFF vs. PNG. https://twitter.com/andrewpprice/status/1440498403633291274?s=12 TIFF should be the better option for the work around until the issue is fixed. Autodesk Flame has an image processing node where you can change the bit-depth of every source. A simple checkbox in the texture image node in Blender could promote an 8-bit buffer to float if you click on it.
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:00:45 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#76680
No description provided.