Color picker malfunctions after manually entering hex value with full red channel #115562

Closed
opened 2023-11-29 07:36:52 +01:00 by Sun Kim · 6 comments
Contributor

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.17

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-28 21:58, hash: 09caf5969010
Worked: 3.6

Caused by 1bcf31a874

Short description of error
Color picker malfunctions after manually entering a hex value with full red channel (#FFxxxx).

As far as I can see this happens in material, world, geometry nodes modifier panels, and pickers inside nodes. It does not happen with pickers in the sculpt/vertex/texture paint tools and bone display color selection. I guess this only happens with pickers in user-created data?

Once the picker is broken it stays broken for that input, for that file, even after re-launching Blender and loading the file.

Here is the file with broken pickers: color_picker_issue.blend

Also, while the pickers don't break in 3.6, loading the broken file in 3.6 shows the same broken pickers.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.17 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-28 21:58, hash: `09caf5969010` Worked: 3.6 Caused by 1bcf31a874 **Short description of error** Color picker malfunctions after manually entering a hex value with full red channel (#FFxxxx). <video src="/attachments/f95d3175-e58d-425b-931f-8b5f5e0cb091" title="color_picker_issue.mp4" controls></video> As far as I can see this happens in material, world, geometry nodes modifier panels, and pickers inside nodes. It does not happen with pickers in the sculpt/vertex/texture paint tools and bone display color selection. I guess this only happens with pickers in user-created data? Once the picker is broken it stays broken for that input, for that file, even after re-launching Blender and loading the file. Here is the file with broken pickers: [color_picker_issue.blend](/attachments/9a39dace-80e9-42e1-907d-dc2848a54bd8) Also, while the pickers don't break in 3.6, loading the broken file in 3.6 shows the same broken pickers.
Sun Kim added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-11-29 07:36:53 +01:00
Member

Hi, can confirm. Can not bisect atm (don't have intermediate build right now to narrow down good-bad commits)

Hi, can confirm. Can not bisect atm (don't have intermediate build right now to narrow down good-bad commits)
Member

Will check on this

Will check on this
Member

Caused by 1bcf31a874

CC @Sergey
CC @Eary

Caused by 1bcf31a874fb4e9444bf66e43e16fa58dcee20bf CC @Sergey CC @Eary
Contributor

The reason seems to be the precision in calculating the "XYZ D65 to Lin709" matrix.

Replace in the config the Linear Rec.709 stanza with this should solve the issue:

  - !<ColorSpace>
    name: Linear Rec.709
    aliases: [Linear, Linear BT.709, Linear BT.709 I-D65, Linear Tristimulus, linrec709, Utility - Linear - sRGB, Utility - Linear - Rec.709, lin_srgb, Linear Rec.709 (sRGB), lin_rec709_srgb, lin_rec709, lin_srgb, "CGI: Linear - Rec.709"]
    family: Linear
    equalitygroup:
    bitdepth: 32f
    description: |
      Linear BT.709 with illuminant D65 white point
    isdata: false
    from_scene_reference: !<GroupTransform>
      children:
        - !<ColorSpaceTransform> {src: Linear CIE-XYZ E, dst: Linear CIE-XYZ D65}
        - !<MatrixTransform> {matrix: [3.2404373564920070, -1.5371305409000549, -0.4985288240756933, 0, -0.9692674982687597, 1.8760136862977035, 0.0415560804587997, 0, 0.0556434463874256, -0.2040259700872272, 1.0572254813610864, 0, 0, 0, 0, 1]}
The reason seems to be the precision in calculating the "XYZ D65 to Lin709" matrix. Replace in the config the Linear Rec.709 stanza with this should solve the issue: ``` - !<ColorSpace> name: Linear Rec.709 aliases: [Linear, Linear BT.709, Linear BT.709 I-D65, Linear Tristimulus, linrec709, Utility - Linear - sRGB, Utility - Linear - Rec.709, lin_srgb, Linear Rec.709 (sRGB), lin_rec709_srgb, lin_rec709, lin_srgb, "CGI: Linear - Rec.709"] family: Linear equalitygroup: bitdepth: 32f description: | Linear BT.709 with illuminant D65 white point isdata: false from_scene_reference: !<GroupTransform> children: - !<ColorSpaceTransform> {src: Linear CIE-XYZ E, dst: Linear CIE-XYZ D65} - !<MatrixTransform> {matrix: [3.2404373564920070, -1.5371305409000549, -0.4985288240756933, 0, -0.9692674982687597, 1.8760136862977035, 0.0415560804587997, 0, 0.0556434463874256, -0.2040259700872272, 1.0572254813610864, 0, 0, 0, 0, 1]} ```

The change seems to solve the issue on user level.
Not sure how to go about revieweing the change though. Is there some known ground-truth matrix for this?

@brecht @nathanvegdahl Do you mind having a look here, because it will be nice to solve for 4.0.2 and I might be away for that.

The change seems to solve the issue on user level. Not sure how to go about revieweing the change though. Is there some known ground-truth matrix for this? @brecht @nathanvegdahl Do you mind having a look here, because it will be nice to solve for 4.0.2 and I might be away for that.
Contributor

Is there some known ground-truth matrix for this?

Not that I know of.

The key point seems to be the D65 coordinate.

This is the tool I used for generating the XYZ to RGB matrix:
https://observablehq.com/@danburzo/color-matrix-calculator

It comes with a D65 xy coordinate of (x: 0.31271, y: 0.32902) , and this is also the widely cited D65 coordinate.

But now I looked into it, different sources seems to disagree on the actual coordinate of D65:

https://en.wikipedia.org/wiki/Talk:Standard_illuminant#Series_D

All of these seems super complex and controversial, and is beyond my math ability to understand.

All I get from this is that, the D65 coordinate doesn't have a single ground-truth value, it depends on the method they calculated it, as well as some different way of rounding different values in different steps that they do.

The new matrix from my above comment took the D65 XYZ coordinate from this site:
http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html

(I have varified the adaptation matrices listed in the site with this script so I trust this source)

X = 0.95047, Y = 1, Z = 1.08883

I ran it through the XYZ to xyY calculator:
http://www.brucelindbloom.com/index.html?ColorCalculator.html

The result is x = 0.312727, y= 0.329023

Then I pasted the result value back to the RGB matrix generator tool, and got the above matrix I posted. And it seems to work.

> Is there some known ground-truth matrix for this? Not that I know of. The key point seems to be the D65 coordinate. This is the tool I used for generating the XYZ to RGB matrix: https://observablehq.com/@danburzo/color-matrix-calculator It comes with a D65 xy coordinate of (x: 0.31271, y: 0.32902) , and this is also the widely cited D65 coordinate. But now I looked into it, different sources seems to disagree on the actual coordinate of D65: https://en.wikipedia.org/wiki/Talk:Standard_illuminant#Series_D All of these seems super complex and controversial, and is beyond my math ability to understand. All I get from this is that, the D65 coordinate doesn't have a single ground-truth value, it depends on the method they calculated it, as well as some different way of rounding different values in different steps that they do. The new matrix from my above comment took the D65 XYZ coordinate from this site: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html (I have varified the adaptation matrices listed in the site with [this script](https://github.com/EaryChow/Chromatic-Adaptation-Matrix-Generator/blob/main/chromatic_adaptation_matrix_generator.py) so I trust this source) X = 0.95047, Y = 1, Z = 1.08883 I ran it through the XYZ to xyY calculator: http://www.brucelindbloom.com/index.html?ColorCalculator.html The result is x = 0.312727, y= 0.329023 Then I pasted the result value back to the RGB matrix generator tool, and got the above matrix I posted. And it seems to work.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-12-04 20:06:11 +01:00
Brecht Van Lommel added
Type
Bug
and removed
Type
Report
labels 2023-12-11 16:08:01 +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#115562
No description provided.