Skip to content

Alpha channel should be 1 by default, rather than 0 - #2197

Merged
doug-walker merged 9 commits into
AcademySoftwareFoundation:mainfrom
pennelee:feature/1781_2025_alpha_channel_one
Mar 5, 2026
Merged

Alpha channel should be 1 by default, rather than 0 #2197
doug-walker merged 9 commits into
AcademySoftwareFoundation:mainfrom
pennelee:feature/1781_2025_alpha_channel_one

Conversation

@pennelee

Copy link
Copy Markdown
Contributor

Related to issue #1781.

For CPU processor, when source has no alpha (RGB) but dest does (RGBA) make it default to 1.
GPU Processors (new and legacy) did not seem to have this issue, alpha was already set to 1. Let me know if this is not the case.

Tested changes with ocioconvert and changed the output to force RGBA, since the default is to use inplace conversion (did not check in those changes).
Tested with all the ocioconvert test cases (basic, --lut, --view, --invertview --namedtransform, --invnamed transform), and various EXR file sizes.

Before the changes alpha would be 0, so image was not viewable. After the changes then images can be viewed and from inspection the alpha channel is now 1.0.

Also updated related CPU tests to reflect non zero alpha values.

Signed-off-by: pylee <penne.y.lee@intel.com>
@doug-walker

Copy link
Copy Markdown
Collaborator

Thanks for the contribution @pennelee !

Added the devdays25 label.

Comment threadsrc/OpenColorIO/ImagePacking.cpp Outdated
@pennelee
pennelee requested a review from cozdasFebruary 1, 2026 06:44
@pennelee

Copy link
Copy Markdown
ContributorAuthor

Hi @cozdas ,
Finally I have made some update, could you please review again and let me know if you have any feedback. Thank you.

@cozdascozdas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pennelee,
The unit test expected values are now making much more sense, thanks for the fix but the value that needs to be used should be derived from the input bit depth, not output, I added comments to some of the relevant lines.

I believe the tests will still pass when you use the input depth instead of the output.

Comment threadsrc/OpenColorIO/ImagePacking.cpp Outdated
Comment threadsrc/OpenColorIO/ImagePacking.cpp Outdated
Comment threadsrc/OpenColorIO/ImagePacking.cpp Outdated
Comment threadsrc/OpenColorIO/ScanlineHelper.cpp Outdated
penneleeand others added 4 commits February 2, 2026 21:21
Signed-off-by: pylee <penne.y.lee@intel.com>
Signed-off-by: pylee <penne.y.lee@intel.com>
Signed-off-by: pylee <penne.y.lee@intel.com>

@cozdascozdas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just added a minor suggestion.
Thanks for the fixes.

Comment threadsrc/OpenColorIO/ImagePacking.cpp Outdated
Co-authored-by: Cuneyt Ozdas <github@cuneytozdas.com>
Signed-off-by: PenneLee <pennelee@gmail.com>
@pennelee

Copy link
Copy Markdown
ContributorAuthor

Hi @doug-walker - Could you also review the changes? Thank you!

@doug-walkerdoug-walker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing through on this @pennelee , it was a challenging one!

@doug-walker
doug-walker merged commit d9eb50c into AcademySoftwareFoundation:mainMar 5, 2026
26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@pennelee@doug-walker@cozdas