Dark stripes rendering .PSD image texture in cycles #75221

Closed
opened 2020-03-30 19:57:54 +02:00 by Sebastien Larocque · 15 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.28

Blender Version
Broken: version: 2.83 (sub 11), branch: master, commit date: 2020-03-29 21:36, hash: a103d09df4

Short description of error

There is a banding (or line) effect in Cycles when using transparent gradient textures with attached file.
Image color data contains a bit darker stripes, that aren't in original image file, but given that eevee doesn't exhibit this bug this may not be only problem here.

Exact steps for others to reproduce the error

  • Open the .blend file attached.

  • Set the viewport shading to "Display render preview" (with Cycles) or do a render of the scene.

  • The banding effect becomes more apparent when zooming in.

  • The scene object “Gradient01” has the material “Gradient01” with the sRBG color-space texture.

  • To fix, the problem, someone can change the color space of the image node to Non-Color or Raw. Linear color space has the same kind of effect as sRGB, but less apparent.

  • As the gradient fades out to more transparency, there are darker bands appearing at different regular intervals.

{F8437251 size=full}

Gradient01.psd

Cycles - Alpha Banding.blend

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.28 **Blender Version** Broken: version: 2.83 (sub 11), branch: master, commit date: 2020-03-29 21:36, hash: `a103d09df4` **Short description of error** There is a banding (or line) effect in Cycles when using transparent gradient textures with attached file. Image color data contains a bit darker stripes, that aren't in original image file, but given that eevee doesn't exhibit this bug this may not be only problem here. **Exact steps for others to reproduce the error** * Open the .blend file attached. * Set the viewport shading to "Display render preview" (with Cycles) or do a render of the scene. * The banding effect becomes more apparent when zooming in. * The scene object “Gradient01” has the material “Gradient01” with the sRBG color-space texture. * To fix, the problem, someone can change the color space of the image node to Non-Color or Raw. Linear color space has the same kind of effect as sRGB, but less apparent. * As the gradient fades out to more transparency, there are darker bands appearing at different regular intervals. {[F8437251](https://archive.blender.org/developer/F8437251/AlphaBanding.png) size=full} ![Gradient01.psd](https://archive.blender.org/developer/F8437248/Gradient01.psd) [Cycles - Alpha Banding.blend](https://archive.blender.org/developer/F8437249/Cycles_-_Alpha_Banding.blend)

Added subscriber: @SebBlender

Added subscriber: @SebBlender

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

When looking at pixel values in image editor, you can see that color data is not correct.
PNG doesn't have this issue in this case.

When looking at pixel values in image editor, you can see that color data is not correct. PNG doesn't have this issue in this case.
Richard Antalik changed title from sRBG color space in image node creates banding effects with alpha/transparent gradients to Dark stripes rendering .PSD image in cycles 2020-04-01 11:18:01 +02:00
Richard Antalik changed title from Dark stripes rendering .PSD image in cycles to Dark stripes rendering .PSD image texture in cycles 2020-04-01 11:18:26 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Am not sure how well we support PSD files… Thhink it’s through OpenImageIO currently?

Anyway, this belongs to #vfx_video project, not to #data_assets_i_o one imho.

Am not sure how well we support PSD files… Thhink it’s through OpenImageIO currently? Anyway, this belongs to #vfx_video project, not to #data_assets_i_o one imho.

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Brecht Van Lommel self-assigned this 2020-05-13 21:16:10 +02:00

These artifacts are already present in the PSD file, which presumably is compressed or was created from a compressed image. If you look at the alpha channel in the image editor and zoom in you can see this is not actually a smooth gradient.

The artifact shows up as "banding" because the pixels are stretched very wide on this mesh.

These artifacts are already present in the PSD file, which presumably is compressed or was created from a compressed image. If you look at the alpha channel in the image editor and zoom in you can see this is not actually a smooth gradient. The artifact shows up as "banding" because the pixels are stretched very wide on this mesh.

In #75221#930927, @brecht wrote:
These artifacts are already present in the PSD file, which presumably is compressed or was created from a compressed image. If you look at the alpha channel in the image editor and zoom in you can see this is not actually a smooth gradient.

The artifact shows up as "banding" because the pixels are stretched very wide on this mesh.

I think, that issue is that this .PSD file is incorrectly imported. When viewed in gimp gradient is actually smooth and color has value of 1 for all pixels.

> In #75221#930927, @brecht wrote: > These artifacts are already present in the PSD file, which presumably is compressed or was created from a compressed image. If you look at the alpha channel in the image editor and zoom in you can see this is not actually a smooth gradient. > > The artifact shows up as "banding" because the pixels are stretched very wide on this mesh. I think, that issue is that this .PSD file is incorrectly imported. When viewed in gimp gradient is actually smooth and color has value of 1 for all pixels.

I see the same artifacts in the alpha channel in GIMP. Colors > Components > Decompose, then choose Alpha.

I see the same artifacts in the alpha channel in GIMP. Colors > Components > Decompose, then choose Alpha.

Ah sorry you are correct. I must have screwed up extracting this channel.

Ah sorry you are correct. I must have screwed up extracting this channel.

I also tried to decompose the alpha channel in Gimp and I do not get any stripes. Everything looks normal to me.

What should provide a clue about the source of the problem is the color space of the texture node that I tested as mentioned initially in my report. Changing from sRGB to Non-Color space solves the problem. So far, it’s the only solution or workaround to this problem.

Furthermore, Eeve does not have this problem. If it was really in the PSD file, I presume that Eeve would render the image with the same information.

I created another project to test the alpha channel in Blender. I used the same texture “Gradient01.psd”. I created another object "Gradient02" where I used an opaque black and white color ramp where the value is influenced by the alpha channel of the gradient texture in the same sRGB color space. The result is a perfect progressive gradient.

To me the alpha channel seems correct. I could not find any problem outside Blender and it seems related to the use of the color space and the PSD file. Maybe the library used to read the PSD file has a bug. Is this provided by Adobe?

Maybe this has a connection with the color profile found in the PSD file.

Cycles - Alpha Banding2.blend

I also tried to decompose the alpha channel in Gimp and I do not get any stripes. Everything looks normal to me. What should provide a clue about the source of the problem is the color space of the texture node that I tested as mentioned initially in my report. Changing from sRGB to Non-Color space solves the problem. So far, it’s the only solution or workaround to this problem. Furthermore, Eeve does not have this problem. If it was really in the PSD file, I presume that Eeve would render the image with the same information. I created another project to test the alpha channel in Blender. I used the same texture “Gradient01.psd”. I created another object "Gradient02" where I used an opaque black and white color ramp where the value is influenced by the alpha channel of the gradient texture in the same sRGB color space. The result is a perfect progressive gradient. To me the alpha channel seems correct. I could not find any problem outside Blender and it seems related to the use of the color space and the PSD file. Maybe the library used to read the PSD file has a bug. Is this provided by Adobe? Maybe this has a connection with the color profile found in the PSD file. [Cycles - Alpha Banding2.blend](https://archive.blender.org/developer/F8535772/Cycles_-_Alpha_Banding2.blend)

Cycles texture interpolation is intentionally different (following typical offline renderers, while Eevee follows game engines). That means alpha is premultiplied before interpolation, and will affect color channels.

Changing color spaces will also mask such issues, as it may round values.

I see the same noise in the alpha channel in macOS preview. I see no reason to assume there is a problem in PSD file reading.

In any case PSD is a poor file format for texture mapping. While it should generally work, we won't invest much time in investigating corner cases like this.

Cycles texture interpolation is intentionally different (following typical offline renderers, while Eevee follows game engines). That means alpha is premultiplied before interpolation, and will affect color channels. Changing color spaces will also mask such issues, as it may round values. I see the same noise in the alpha channel in macOS preview. I see no reason to assume there is a problem in PSD file reading. In any case PSD is a poor file format for texture mapping. While it should generally work, we won't invest much time in investigating corner cases like this.

I don’t understand all the mechanics behind Blender. You seem to understand quite well. However, there are a couple of things to rectify.

You marked my report as “invalid”. I disagree with that. The problem is real. I agree that it might not be a priority when you consider other issues being reported.

There are other software like ACDSee which read properly the PSD file format with transparency. I assume there are ways to handle this.

The fact that you describe PSD as a poor file format is something very subjective. I don’t consider PSD being poor. Among the image formats with layers, it’s the most popular. It’s also very convenient to be able to modify the PSD file and just reload the file in Blender instead of doing an export every time to a PNG. It saves some time. It’s also widely used by the game engine Unity because of its characteristics with layers.

My recommendation is to keep my report valid, but instead assign a priority that respect the rest of your development. This would certainly be more useful for me if that worked, but the final decision is yours.

I don’t understand all the mechanics behind Blender. You seem to understand quite well. However, there are a couple of things to rectify. You marked my report as “invalid”. I disagree with that. The problem is real. I agree that it might not be a priority when you consider other issues being reported. There are other software like ACDSee which read properly the PSD file format with transparency. I assume there are ways to handle this. The fact that you describe PSD as a poor file format is something very subjective. I don’t consider PSD being poor. Among the image formats with layers, it’s the most popular. It’s also very convenient to be able to modify the PSD file and just reload the file in Blender instead of doing an export every time to a PNG. It saves some time. It’s also widely used by the game engine Unity because of its characteristics with layers. My recommendation is to keep my report valid, but instead assign a priority that respect the rest of your development. This would certainly be more useful for me if that worked, but the final decision is yours.
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
4 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#75221
No description provided.