Regression: image.save_render() command changes color profile and file type when saving. #98444
Labels
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#98444
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ubuntu 22.04
Nvidia 1070 Ti
Broken: version: 3.3.0 Alpha May 18
89ccff62d2
Worked: 3.2 May 2
5188c14718
When you save a newly baked float Normal Image with Linear profile using the
bpy.data.images["Untitled"].save_render("/path/to/save/file.exr")
command, blender saves it as a 16 bit PNG with sRGB values and a.exr
extension.Previously it would save the image buffer as a linear OpenEXR Image file.
Steps:
1 -Bake a float normal map in memory in Linear color profile
2 - Save the picture with save_render python command.
3 - open the
.exr
in image editor.4 - You will see the color profile loaded as sRGB.
5 - Various other programs won't open it because it is actually a 16 bit PNG file with the wrong extension.
blendFile: test.blend
Working video 3.2: https://www.dropbox.com/s/e4mat4i77ix6i7q/2022-05-27%2010-18-27.mp4?dl=0
Non Working video 3.3: https://www.dropbox.com/s/35x24pobe6plafp/2022-05-27%2010-21-14.mp4?dl=0
Same procedure, different result.
Added subscriber: @EugenioPignataro
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs User Info'
Does EXR images store color profiles at all? As far as I know, EXR files can't store the color space, so this is most likely Blender assuming a color space upon reading the image back.
It loads as linear for me regardless. Does this happen with the default OCIO config and factory settings?
Hi Omar! In the previous versions this worked fine.
Blender saves pixel information baked as sRGB.
If I set the image loaded as Linear (normal map):
I've tried with default OCIO, same problem.
I made a new video:
https://www.dropbox.com/s/xnrbfgnproc5tko/2022-05-27%2011-18-33.mp4?dl=0
blendFile: test.blend
This is an older .exr in the newest blender version.
it's working fine.
I believe that the problem is in the save step.
In 3.2 in your video, it seems to be loaded as
sRGB OETF
, not linear, which is contrary to what you want, right?It loads as sRGB in both versions for me. My point was that EXR files don't actually store any color space information, so Blender make make the decision based on something else.
Hi Omar, we are testing the last blender build with my partner.
We are close to find the problem.
The last version it seems to be using color management options for saving the file.
The previous versions doesn't force the use of the CM options to save the images with "save_render()"
The usual way to load an EXR Normal Map is in Linear, and the undistorted base value is .5 .5 1
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscriber: @NahuelBelich
I have the blender defaults color management and notice the same behaviuor with the test file provided in the comments(following the steps).
With the blender default i can reproduce the problem, its using the Color management options instead of saving linear. This may or not be a big issue but something to consider, however we also notice a second big (huge) issue that could be related to this, saving exr files using the console can no longer be opened with Krita, it returns an error
(QString::arg: Argument missing: Loading canceled. Error:)
nor can be opened in djview imagin 2.0.6
Working properly build:
hash:
56d1d19c88
commit date: 2022-04-20 14:55
oldest failing build i have
hash:
89ccff62d2
commit date: 2022-05-18 21:09
Added subscriber: @EAW
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm.
@EugenioPignataro your English is perfectly understandable. 😀
@NahuelBelich It turns out that Blender is saving them as 16bit PNG files with the .exr extension.
Ifranview 4.58 gives the error message of
Examining the file in a HEX editor confirms that it is a PNG file. Changing the extension allows the file to be opened normally.
I'll update the report.
I won't be able to bisect until tommorow.
Error image.save_render() command color profile.to Regression: image.save_render() command changes color profile and file type when saving.Ohh thanks Evan! thanks Omar.
We are working on a PBR Baker Addon, so... save_render command is very important for us.
thank you very much again!
Added subscribers: @brecht, @mont29
@brecht this one might be for you I think? Thanks.
I'll restore the old behavior.
Note that technically normal maps should be set to Non-Color instead of Linear. With the default OpenColorIO config you might not notice the difference, but in general it will not work correctly.
This issue was referenced by
fc1ae52994
Changed status from 'Confirmed' to: 'Archived'
Actually, looking closer I don't think this is a bug.
Blender 3.1.2, 3.2 and 3.3 are all saving a PNG file with EXR extension. It uses the settings in the Output panel, the extension in the file path is not what determines the file type.
The difference is in this bugfix from
5baa3ec
.That is, 16 bit PNG would save renders without color space conversion (i.e. Linear), while 8 bit PNG would do the proper color space conversion. However both should work the same way, PNG files have a 0..1 range and can't store linear HDR colors, regardless if it's 8 bit or 16 bit.
If you want to save a non-color image through the render pipeline, you need to either:
Hi Bretch, thanks for your help.
I'm following your instructions:
Output
CM
Run command:
bpy.data.images['Untitled'].save_render("/home/tomate/test.exr")
Djv error:
What am I doing wrong?
If I save the picture from uv/imageEditor space everything works fine!
Save as:
Djv works fine:
And blender recognizes the color profile.
I tried everything, but I can't get a good result.
Thanks a bunch.
Ok, it seems there is a bug where this output setting is ignored. It was confusing because the example blend had this set to PNG while presumably your real test case had it set to EXR.
Changed status from 'Archived' to: 'Resolved'
Now blender works fine!
Thanks Brecht!
This issue was referenced by None@62938