Here we save a transparent gif using the color of the pixel at
position 10,10 as the transparent color.
[C#]
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/jeremy-bishop-_CFv3bntQlQ-unsplash.jpg"))) {
EncoderParameters pars = new EncoderParameters() { TransparentPoint = new PointF(10, 10) };
pars.Palette = new ColorPaletteType(ColorPaletteFamily.Adaptive, 8);
bm.Save(Server.MapPath("IG8_EncoderParameters_TransparentPoint.gif"), ImageFormat.Gif, pars);
}

jeremy-bishop-_CFv3bntQlQ-unsplash.jpg

IG8_EncoderParameters_TransparentPoint.gif
|