Skip to content

Certain PNGs with transparent background are corrupted when written to filepath with JPG extension #1701

Answered by dlemstra
atantapr asked this question in Help
Discussion options

You must be logged in to vote

This is not wrong but caused by your input image. This is happening because the alpha channel is turned off. The same will happen if you call image.Alpha(AlphaOption.Off and save your image as a png file or any other format. I would advise you to call image.ColorAlpha(MagickColors.White) first before writing the image because not all transparent pixels have a while color "behind them".

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@atantapr
Comment options

@atantapr
Comment options

@dlemstra
Comment options

Answer selected by atantapr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1699 on August 24, 2024 14:09.