Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle premultiplied alpha for grayscale PNGs. #2047

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

j-jorge
Copy link
Contributor

@j-jorge j-jorge commented Jul 20, 2024

This commit adds support for premultiplied alpha on grayscale PNGs with alpha.

The assignment of Image::_hasPremultipliedAlpha was conditioned on the pixel format being RGBA8. Consequently, grayscale textures with alpha did not take this route and ended up with _hasPremultipliedAlpha = false which would cause artifacts if the file actually did contain premultiplied alpha.

In this commit I extend the conditional to include RA8 (RG8 in Axmol) and complete Image::multiplyAlpha to handle this case too.

@halx99 halx99 added the enhancement New feature or request label Jul 23, 2024
@halx99 halx99 added this to the 2.1.5 milestone Jul 23, 2024
@halx99 halx99 merged commit b4667ac into axmolengine:dev Jul 23, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants