This project has moved and is read-only. For the latest updates, please go here.

Bitmap Image to 1Bpp image

May 7, 2015 at 5:55 AM
I want to convert Bitmap image to 1Bpp format
May 7, 2015 at 8:20 AM
What is the type of the output format that you want? Do I understand you correctly that you want a monochrome image? With 1 bit per pixel.
May 7, 2015 at 9:31 AM
Edited May 7, 2015 at 2:06 PM
yes, i want to convert bitmap to 1bpp image (color to only black and white image).

thank you for your reply, i am waiting for your answer.
May 7, 2015 at 4:43 PM
You can use the Threshold or the Quantize method of MagickImage for this.
May 8, 2015 at 6:43 AM
Can you please share your code...., because i am not getting exact what i want.
May 8, 2015 at 10:46 AM
Edited May 8, 2015 at 10:47 AM
I don't know what you want exactly but here are some examples (I forgot about setting ColorType to BiLevel earlier):
using (MagickImage image = new MagickImage("logo:"))
    image.Depth = 1;

using (MagickImage image = new MagickImage("logo:"))
    image.ColorType = ColorType.Bilevel;
    image.Depth = 1;

using (MagickImage image = new MagickImage("logo:"))
    QuantizeSettings settings = new QuantizeSettings();
    settings.ColorSpace = ColorSpace.GRAY;
    settings.Colors = 2;

    image.Depth = 1;
You might want to add some links to images that explain what kind of result you want if the result from these examples are incorrect.
May 8, 2015 at 12:24 PM
thank you so much for your reply, its working.