IMB: Read single-layer XYZ channels as a combined image #115290

Merged
Omar Emara merged 4 commits from OmarEmaraDev/blender:openexr-read-xyz-channels into main 2023-12-13 10:01:19 +01:00
Member

Currently, the OpenEXR reader can't read single-layer XYZ images as a
combined image. Single-view images will only read the X channel, while
multi-view images will interpret the Z as a depth image and the Y and Z
channels will be treated as float passes.

This patch allows the reading of XYZ channels as combined images. For
single-view images, we just extend the RGB-like channel names we match
to contain XYZ. For multi-view images we only treat the Z channel as a
Depth one if no X and Y channels exists, since the Z in this case is
part of the XYZ image.

Currently, the OpenEXR reader can't read single-layer XYZ images as a combined image. Single-view images will only read the X channel, while multi-view images will interpret the Z as a depth image and the Y and Z channels will be treated as float passes. This patch allows the reading of XYZ channels as combined images. For single-view images, we just extend the RGB-like channel names we match to contain XYZ. For multi-view images we only treat the Z channel as a Depth one if no X and Y channels exists, since the Z in this case is part of the XYZ image.
Omar Emara added the
Interest
Compositing
Module
VFX & Video
labels 2023-11-23 07:51:16 +01:00
Omar Emara added 1 commit 2023-11-23 07:51:27 +01:00
dc230a2950 IMB: Read single layer XYZ channels as a combined image
Currently, the OpenEXR reader can't read single-layer XYZ images as a
combined image. Single-view images will only read the X channel, while
multi-view images will interpret the Z as a depth image and the Y and Z
channels will be treated as float passes.

This patch allows the reading of XYZ channels as combined images. For
single-view images, we just extend the RGB-like channel names we match
to contain XYZ. For multi-view images we only treat the Z channel as a
Depth one if no X and Y channels exists, since the Z in this case is
part of the XYZ image.
Omar Emara requested review from Sergey Sharybin 2023-11-23 07:51:48 +01:00

If we are saving vector data as XYZ it does make sense to be open it as XYZ. So from this point of view the patch makes sense.

What I am confused a bit, is the specs of the EXR. Y is for luminance, Z is for depth. And I can't find some specification which will cover a topic of when channels are combined together.

@brecht What does your knowledge say here? :)

If we are saving vector data as XYZ it does make sense to be open it as XYZ. So from this point of view the patch makes sense. What I am confused a bit, is the specs of the EXR. Y is for luminance, Z is for depth. And I can't find some specification which will cover a topic of when channels are combined together. @brecht What does your knowledge say here? :)

There are no strict rules here, and we indeed need heuristics like this. The OpenEXR specs are also not followed by various apps.

Did you check if chroma is imported correctly?

I would expect:
Y only -> chroma
Y BY RY -> YCC
Z only -> depth
X Y Z -> XYZ vector

There are no strict rules here, and we indeed need heuristics like this. The OpenEXR specs are also not followed by various apps. Did you check if chroma is imported correctly? I would expect: Y only -> chroma Y BY RY -> YCC Z only -> depth X Y Z -> XYZ vector
Omar Emara added 1 commit 2023-11-27 13:36:11 +01:00
Author
Member

@brecht I unfortunately couldn't test chroma images, because all sample images I trid used subsampling, which is something we apparently do not handle at the moment. I tried a quick fix for that but it will take more time as it doesn't seem straightforward.

Do you happened to have samples images I can test?

Regardless, I refactored the patch a bit to be more explicit in those cases.

@brecht I unfortunately couldn't test chroma images, because all sample images I trid used subsampling, which is something we apparently do not handle at the moment. I tried a quick fix for that but it will take more time as it doesn't seem straightforward. Do you happened to have samples images I can test? Regardless, I refactored the patch a bit to be more explicit in those cases.
This seems to be one with just Y: https://github.com/AcademySoftwareFoundation/openexr-images/blob/main/LuminanceChroma/Garden.exr
Brecht Van Lommel approved these changes 2023-11-27 13:54:16 +01:00
Omar Emara added 1 commit 2023-11-27 14:02:10 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
166522f8fc
Broadcast Y to all three channels
Author
Member

@blender-bot build

@blender-bot build
Omar Emara added 1 commit 2023-11-27 15:09:01 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
0ba009a01b
Merge branch 'main' into openexr-read-xyz-channels
Author
Member

@blender-bot build

@blender-bot build
Omar Emara merged commit 23df139aaf into main 2023-12-13 10:01:19 +01:00
Omar Emara deleted branch openexr-read-xyz-channels 2023-12-13 10:01:21 +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
3 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#115290
No description provided.