What is the easiest way to convert and save a 32-bit Bitmap to a 1-bit (black/white) .bmp file in C#?
Ctrl+Shift+S (Save As...) > choose . bmp > then a dialog comes up (BMP Options) asking you which type (16, 24 or 32 bit) and which file format (Windows or OS/2). Just tell it to use 32 bit and Windows then select ok.
The easiest way to do achieve this by using the Clone()
using System.Drawing.Imaging;
var original = //your source image;
var rectangle = new Rectangle(0, 0, original.Width, original.Height);
var bmp1bpp = original.Clone(rectangle, PixelFormat.Format1bppIndexed);
As disclaim this will maybe not the fastest way to do this there are much faster way's to do this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With