Alpha channel effecting other channels with a TGA image. #36252

Closed
opened 2013-07-22 20:00:37 +02:00 by B Y · 8 comments

%%%--- Operating System, Graphics card ---
Windows 7 sp1 and Nvidia Quadro FX 580
Windows XP sp3 and Nvidia Geforce 9800 GT

- Blender version with error, and version that worked ---

2.68 - broken
2.65 - works
2.63 - works

- Short description of error ---

I have a TGA with two circles, one red and one blue. The alpha channel is set to display part of the red circle. Using the separate channels node to remove the alpha and reveal the blue circle no longer works.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---
  1. Using a "image node" select the "circles.tga" image.
  2. Connect it to a "Separate RGBA node"
  3. Connect the Blue channel to either a "viewer node" or a "composite node."

in 2.63 - 2.65 there will be a white circle as the alpha channel was properly removed revealing the blue channel.
screen shot:
http://imagebin.org/265268

in 2.8 the image will (incorrectly) be black. It seems as if the alpha channel is removing color data from the source image .
screen shot:
http://imagebin.org/265270

P.S. While this is similar to an earlier issue I had reported earlier. I believe this is a simpler example and more accurate description of the problem I'm experiencing. I have not yet found a solution to this bug other than to separate the alpha channel in another application first.%%%

%%%--- Operating System, Graphics card --- Windows 7 sp1 and Nvidia Quadro FX 580 Windows XP sp3 and Nvidia Geforce 9800 GT - Blender version with error, and version that worked --- 2.68 - broken 2.65 - works 2.63 - works - Short description of error --- I have a TGA with two circles, one red and one blue. The alpha channel is set to display part of the red circle. Using the separate channels node to remove the alpha and reveal the blue circle no longer works. - Steps for others to reproduce the error (preferably based on attached .blend file) --- 1. Using a "image node" select the "circles.tga" image. 2. Connect it to a "Separate RGBA node" 3. Connect the Blue channel to either a "viewer node" or a "composite node." in 2.63 - 2.65 there will be a white circle as the alpha channel was properly removed revealing the blue channel. screen shot: http://imagebin.org/265268 in 2.8 the image will (incorrectly) be black. It seems as if the alpha channel is removing color data from the source image . screen shot: http://imagebin.org/265270 P.S. While this is similar to an earlier issue I had reported earlier. I believe this is a simpler example and more accurate description of the problem I'm experiencing. I have not yet found a solution to this bug other than to separate the alpha channel in another application first.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%The problem is caused by the new compositor using the rect_float values of the image buffer (ImBuf) instead of the rect byte array (see BaseImageOperation::getImBuf(), calling IMB_float_from_rect(ibuf)). This works fine in general, but rect_float is always premultiplied with alpha, which causes the color channels to lose all information in 0-alpha areas (i.e. the blue circle in this case is gone). RGBA splitting becomes pretty much useless for such masking purposes.%%%

%%%The problem is caused by the new compositor using the rect_float values of the image buffer (ImBuf) instead of the rect byte array (see BaseImageOperation::getImBuf(), calling IMB_float_from_rect(ibuf)). This works fine in general, but rect_float is *always* premultiplied with alpha, which causes the color channels to lose all information in 0-alpha areas (i.e. the blue circle in this case is gone). RGBA splitting becomes pretty much useless for such masking purposes.%%%

%%%This is the intended behavior now, we did a major refactor of the alpha handling system in 2.66:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Image_Transparency

The compositor now always uses premultiplied alpha rather than the user having to set this manually. That reduces some flexibility for cases where you want to use the alpha channel in strange ways where it's not actually the transparency in the image, but overall also helps us get rid of artifacts and errors .

The workaround for a case like this is indeed to load the image twice, once with Use Alpha disabled in the image settings.%%%

%%%This is the intended behavior now, we did a major refactor of the alpha handling system in 2.66: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Image_Transparency The compositor now always uses premultiplied alpha rather than the user having to set this manually. That reduces some flexibility for cases where you want to use the alpha channel in strange ways where it's not actually the transparency in the image, but overall also helps us get rid of artifacts and errors . The workaround for a case like this is indeed to load the image twice, once with Use Alpha disabled in the image settings.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author

%%%Thanks for the feedback and potential workaround, but there still is a problem, and I'm not sure if this is windows only, but in Blender 2.68a when I select the image node there is no checkbox for "Use Alpha" it just shows the alpha type below the colorspace. If that checkbox were there this would be an acceptable workaround.%%%

%%%Thanks for the feedback and potential workaround, but there still is a problem, and I'm not sure if this is windows only, but in Blender 2.68a when I select the image node there is no checkbox for "Use Alpha" it just shows the alpha type below the colorspace. If that checkbox were there this would be an acceptable workaround.%%%

%%%The node only shows a subset of all image options, you can find all of them when selecting the image in the image editor.%%%

%%%The node only shows a subset of all image options, you can find all of them when selecting the image in the image editor.%%%
Member

%%%I've recently added extended image options in the node editor sidebar (n key), so you don't actually have to open the image editor to access all the details of the image data block. But this is not in 2.68a yet, so unless you use a recent build (e.g. from builder.blender.org) you'll have to use the image editor, until next release.%%%

%%%I've recently added extended image options in the node editor sidebar (n key), so you don't actually have to open the image editor to access all the details of the image data block. But this is not in 2.68a yet, so unless you use a recent build (e.g. from builder.blender.org) you'll have to use the image editor, until next release.%%%
Author

%%%Found it. Indeed this resolves the issue It will be nice to have that in the node options in the future. %%%

%%%Found it. Indeed this resolves the issue It will be nice to have that in the node options in the future. %%%
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#36252
No description provided.