I need to efficiently convert a jpg image to a PNG image with index transparency. Do you know if it is possible (or to have code) for this?
Notes: Index transparency is used to make only one color transparent (usually white), while alpha transparency is used to make all colors in the image transparent.
Answer - Continued
Thanks for the help. Here is the code I just checked.
Bitmap b = new Bitmap(Image.FromFile("c:\\input2.jpg")); b.MakeTransparent(Color.White); b.Save("c:\\output2.png", ImageFormat.Png);
It converts perfectly, but there are various shades of white, and if you plan to make white borders around your image transparent, you will also need to make all of these shades of white transparent.
greetings.
source share