Texture Paint Color Picker Interpreted as Gamma Corrected #88646

Closed
opened 2021-05-28 09:49:47 +02:00 by Jamell Moore · 4 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 465.89

Blender Version
Broken: 3.0.0 alpha

Description of Issue

I'm not sure if there is a bug, if there is a doc issue or neither so I'm asking in multiple places.

The Blender Documentation states:

In Blender, the RGB and HSV/HSL values are in Scene Linear color space, and are therefore not Gamma corrected. On the contrary, Hex are automatically Gamma corrected for the sRGB Color Space. For more information, see Color Management.

Note that Vertex Paint works in sRGB space, and the RGB representation of the same colors will be different between the paint tools and the materials that are in linear space.

But when painting to a linear texture target in texture paint mode, RGB colors appear to be interpreted as gamma corrected srgb for display. Then converted to linear before painting.

This is evident from the color values when using the color sampling tool in image view mode:

texture_paint_color_management_report_02.jpg
texture_paint_color_management_report_03.jpg

This also seems to be supported by the fact that in code, brush.color is converted to linear using IMB_colormanagement_display_to_scene_linear_v3 in image editor texture paint mode.

In paint_image.c L404, the color_correction condition is true when the texture is linear, so the display to scene conversion is applied.

if (color_correction) {
    IMB_colormanagement_display_to_scene_linear_v3(color, display);
}

If the color picker is gamma corrected whilst in this mode, it's confusing to for the user because the documentation states otherwise.

To add to the confusion, brush.color has a PropertySubType of PROP_COLOR_GAMMA but is converted to linear before use.

The code states that PROP_COLOR_GAMMA "is used for colors that would be color managed before display". Therefore I'm interpreting that colors with the type PROP_COLOR_GAMMA are Linear - they will be gamma corrected before display.

Am I interpreting this incorrectly!?

Sorry for the long description.

Steps to see discrepancy

  • From start-up create an image in texture paint mode, with a floating point buffer. This should be linear.
  • Go into image paint mode
  • Select the rgb(0,5, 0.5, 0.5) from the color picker
  • Paint a stroke so that you can sample it
  • Go back to image view mode and use the sample tool to check the color values before and after color management
  • You will see that the unmanaged color values are 0.214 and the color managed values are 0.5
  • Now turn off color management in the render properties tab
  • Paint another stroke with the same color
  • Sample the colors again and you will see that both the unmanaged color and the managed color have values of 0.5.
  • This is evidence that the color is converted to linear. Is this a bug or a design decision?
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 465.89 **Blender Version** Broken: 3.0.0 alpha **Description of Issue** I'm not sure if there is a bug, if there is a doc issue or neither so I'm asking in multiple places. The Blender Documentation states: > In Blender, the RGB and HSV/HSL values are in Scene Linear color space, and are therefore not Gamma corrected. On the contrary, Hex are automatically Gamma corrected for the sRGB Color Space. For more information, see Color Management. > Note that Vertex Paint works in sRGB space, and the RGB representation of the same colors will be different between the paint tools and the materials that are in linear space. But when painting to a linear texture target in texture paint mode, RGB colors appear to be interpreted as gamma corrected srgb for display. Then converted to linear before painting. This is evident from the color values when using the color sampling tool in image view mode: ![texture_paint_color_management_report_02.jpg](https://archive.blender.org/developer/F10148249/texture_paint_color_management_report_02.jpg) ![texture_paint_color_management_report_03.jpg](https://archive.blender.org/developer/F10148264/texture_paint_color_management_report_03.jpg) This also seems to be supported by the fact that in code, `brush.color` is converted to linear using `IMB_colormanagement_display_to_scene_linear_v3` in image editor texture paint mode. In paint_image.c L404, the color_correction condition is true when the texture is linear, so the display to scene conversion is applied. ``` if (color_correction) { IMB_colormanagement_display_to_scene_linear_v3(color, display); } ``` If the color picker is gamma corrected whilst in this mode, it's confusing to for the user because the documentation states otherwise. To add to the confusion, brush.color has a `PropertySubType` of `PROP_COLOR_GAMMA` but is converted to linear before use. The code states that `PROP_COLOR_GAMMA` "is used for colors that would be color managed before display". Therefore I'm interpreting that colors with the type `PROP_COLOR_GAMMA` are Linear - they will be gamma corrected before display. Am I interpreting this incorrectly!? *Sorry for the long description.* **Steps to see discrepancy** - From start-up create an image in texture paint mode, with a floating point buffer. This should be linear. - Go into image paint mode - Select the rgb(0,5, 0.5, 0.5) from the color picker - Paint a stroke so that you can sample it - Go back to image view mode and use the sample tool to check the color values before and after color management - You will see that the unmanaged color values are 0.214 and the color managed values are 0.5 - Now turn off color management in the render properties tab - Paint another stroke with the same color - Sample the colors again and you will see that both the unmanaged color and the managed color have values of 0.5. - This is evidence that the color is converted to linear. Is this a bug or a design decision?
Author

Added subscriber: @JamellMoore

Added subscriber: @JamellMoore
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

This issue is known, but it is not currently considered a bug. #72424 Closing as a duplicate of #77736.

This issue is known, but it is not currently considered a bug. #72424 Closing as a duplicate of #77736.
Member

Closed as duplicate of #77736

Closed as duplicate of #77736
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
2 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#88646
No description provided.