PNG uses alpha transparency, which means that each pixel, in addition to its color, also contains a value indicating its transparency (called alpha ). This allows translucent PNG images.
GIF images use binary transparency, which means that each pixel contains only color, but one of the possible colors is Transparent .
Consequently, the transparent parts of PNG will be painted black, but completely transparent.
When you save a GIF file, the alpha value is ignored, resulting in black.
You need to skip the pixels in the image, replacing any color that has alpha 0 with Color.Transparent .
EDIT : you need to call MakeTransparent
SLaks source share