Fix #104554: 2d paint does not paint with linear color on 32bit images #112631

Open
Philipp Oeser wants to merge 2 commits from lichtwerk/blender:104554 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

When painting in the Image Editor on Non-Color float images, the brush color was
not converted from sRGB to linear, leading to differences painting with
the same brush in the 3DView vs. the Image Editor.

Now corrected by piping the brush color through
srgb_to_linearrgb_v3_v3() when painting on 32bit images.

Should probably go into LTS as well.

When painting in the Image Editor on Non-Color float images, the brush color was not converted from sRGB to linear, leading to differences painting with the same brush in the 3DView vs. the Image Editor. Now corrected by piping the brush color through srgb_to_linearrgb_v3_v3() when painting on 32bit images. Should probably go into LTS as well.
Philipp Oeser added 1 commit 2023-09-20 17:03:58 +02:00
2bba33b62d Fix #104554: 2d paint does not paint with linear color on 32bit images
When painting in the Image Editor on float images, the brush color was
not converted from sRGB to linear, leading to differences painting with
the same brush in the 3DView vs. the Image Editor.

Now corrected by piping the brush color through
srgb_to_linearrgb_v3_v3() when painting on 32bit images.

Should probably go into LTS as well.
Philipp Oeser requested review from Sergey Sharybin 2023-09-20 17:04:08 +02:00
Philipp Oeser requested review from Brecht Van Lommel 2023-09-20 17:04:14 +02:00
Philipp Oeser requested review from Julien Kaspar 2023-09-20 17:04:21 +02:00
Philipp Oeser added this to the Sculpt, Paint & Texture project 2023-09-20 17:04:32 +02:00
Author
Member

Hold on, just realized the fix it is probably more complicated , see #95797 (since now this seems to break 2d painting with textures other than Non Color colorspace)

Hold on, just realized the fix it is probably more complicated , see #95797 (since now this seems to break 2d painting with textures other than `Non Color` colorspace)
Philipp Oeser changed title from Fix #104554: 2d paint does not paint with linear color on 32bit images to WIP: Fix #104554: 2d paint does not paint with linear color on 32bit images 2023-09-20 17:22:26 +02:00
Philipp Oeser added 1 commit 2023-09-20 18:05:54 +02:00
d52c9208f4 only convert to linear if it hasnt been done before
colorspaces other than Non-Color would have converted to linear in
paint_brush_color_get() already.
Author
Member

Hold on, just realized the fix it is probably more complicated , see #95797 (since now this seems to break 2d painting with textures other than Non Color colorspace)

Ah, for non-color, conversion to linear was done already

> Hold on, just realized the fix it is probably more complicated , see #95797 (since now this seems to break 2d painting with textures other than `Non Color` colorspace) Ah, for non-color, conversion to linear was done already
Philipp Oeser changed title from WIP: Fix #104554: 2d paint does not paint with linear color on 32bit images to Fix #104554: 2d paint does not paint with linear color on 32bit images 2023-09-20 18:07:44 +02:00
Author
Member

Hm, sampling in the Image Editor is wrong, too, guess I have to look at this with fresh eyes again

Hm, sampling in the Image Editor is wrong, too, guess I have to look at this with fresh eyes again
Member

I have just tested this issue with a half float precision image set to colorspace Non-Color. Sampling a texture and painting in the texture paint mode. I can verify that this is a bug.

Sampling hotkey is shift+X for anyone testing this.

  • Sampling in image view and painting in image view results in correct color
  • Sampling in 3d view and paint in the 3d view results in correct color
  • Sampling in image view and painting in 3d view results in INCORRECT color

Furthermore I find it strange that the color in the color swatches are not afffected by the scene view transform settings. I would assume the color swatches to have the same color as the colors represented after view transform on the image. The RGB values in the color settings should however represent the true, linear values of the color.

Another observation I made was that the image editor was not affected by the view transform settings in render > color management. This is not desired behaviour. The image editor should result in the same color as in the 3d view.

I have just tested this issue with a half float precision image set to colorspace Non-Color. Sampling a texture and painting in the texture paint mode. I can verify that this is a bug. Sampling hotkey is shift+X for anyone testing this. - Sampling in `image view` and painting in `image view` results in correct color - Sampling in `3d view` and paint in the` 3d view` results in correct color - Sampling in `image view` and painting in `3d view` results in INCORRECT color Furthermore I find it strange that the color in the color swatches are not afffected by the scene view transform settings. I would assume the color swatches to have the same color as the colors represented after view transform on the image. The RGB values in the color settings should however represent the true, linear values of the color. Another observation I made was that the image editor was not affected by the view transform settings in `render > color management`. This is not desired behaviour. The image editor should result in the same color as in the 3d view.
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 104554:lichtwerk-104554
git checkout lichtwerk-104554
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 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#112631
No description provided.