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

Cropping PNG transparent files make the image have a black background #350

Open
Dynamixus opened this issue Dec 24, 2024 · 1 comment
Open

Comments

@Dynamixus
Copy link

Dynamixus commented Dec 24, 2024

When opening a PNG file with a transparent background, it appears with a black background. When I crop it the processed image has a black background instead of a transparent one.

@Raghav-B
Copy link

Raghav-B commented Jan 15, 2025

This happens because the CJPEGImage doesn't really support alpha. The black background is just alpha blended with the image's alpha channel and displayed as an RGB image in the viewport. Any cropping, filtering, etc operations you perform on the image therefore will be on this RGB image and so will be saved with the black background.

This is related to #43 and #287 and is listed as a next feature in this roadmap: #142.

Probably if the CJPEGImage class is updated to support alpha natively, saving and loading should work as well, and support for checkerboard patterns should be easy following that.

@sylikc I could look into this and make a PR if you'd like? It's a feature I've been wanting as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants