I am successfully converting a 24-bit PNG image which has a transparent background to 4-bit PNG image using FreeImage C# wrapper. However, the 4-bit image’s background becomes black instead of being transparent. Here is the code. Any ideas?
FIBITMAP dib = FreeImageAPI.FreeImage.LoadEx(“C:\title_normal.png”);
FreeImage.SetTransparent(dib, true);
FreeImage.SaveEx(ref dib, “C:\title_normal.png”, FREE_IMAGE_FORMAT.FIF_PNG, FREE_IMAGE_SAVE_FLAGS.PNG_Z_DEFAULT_COMPRESSION, FREE_IMAGE_COLOR_DEPTH.FICD_04_BPP, true);
Actually I figured out. Here is the code if someone is interested:
Resulting image is 4-bit transparent PNG!