You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internally the library works with rgba-format. Unfortunately the PNG-encoder in GDI+ ignore the Encoder.ColorDepth parameter which otherwise would have been a good idea to use. The solution is to copy the bitmap image onto a new canvas with the required pixel format and then saving it:
// Assuming that "image" is a KalikoImage object
Bitmap target = new Bitmap(image.Width, image.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(target);
g.DrawImage(image.GetAsBitmap(), new Point(0, 0));
target.Save("24bit.png", ImageFormat.Png);
Adding a pixel format aware save function would be a good feature to add, so I'm adding this to the backlog.
my png's bit depth is 24, but
SavePng
method is 32, which increase the size of the imageThe text was updated successfully, but these errors were encountered: