c# Bitmap.Save transparancy doesn’t save in png

Are you sure the pixel format of the Bitmap is System.Drawing.Imaging.PixelFormat.Format32bppArgb? I just stumbled on this question because I was having the same problem, but it was because I was loading an image which had no alpha component to its pixel format. I did

Bitmap output = original.Clone(rect, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

and it properly saved the PNG with the alpha component.

Also, if you’re using MakeTransparent() be sure that the color you’re making transparent exists in your image.

Leave a Comment