I am working with an old game format and they used indexed bitmaps. For some materials with transparency, they use the first index in the palette as the value that is set to invisible. In code, I clone the bitmap, set this palette value to be fully transparent and then export it as a PNG. It works perfectly on Windows. But on Mac, it does not.
Here is what I do:
Bitmap cloneBitmap;
cloneBitmap = image.Clone(new Rectangle(0, 0, image.Width, image.Height), PixelFormat.Format8bppIndexed);
var palette = cloneBitmap.Palette;
palette.Entries[0] = Color.FromArgb(0, 0, 0, 0);
cloneBitmap.Palette = palette;
cloneBitmap.Save(filePath + fileName, ImageFormat.Png);
This works just fine on PC. The image is output with transparency. On Mac, it does not have transparency, the pixels with this index are just black.