jpegview icon indicating copy to clipboard operation
jpegview copied to clipboard

Cropping PNG transparent files make the image have a black background

Open Dynamixus opened this issue 1 year ago • 2 comments

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.

Dynamixus avatar Dec 24 '24 02:12 Dynamixus

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.

Raghav-B avatar Jan 15 '25 04:01 Raghav-B

yes please new update @Raghav-B @sylikc

justsome12 avatar Jun 28 '25 06:06 justsome12