Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Bitmap Image to 1Bpp image

$
0
0
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.Threshold(50);
    image.Depth = 1;
    image.Write(@"C:\logo-1.png");
}

using (MagickImage image = new MagickImage("logo:"))
{
    image.ColorType = ColorType.Bilevel;
    image.Depth = 1;
    image.Write(@"C:\logo-2.png");
}

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

    image.Quantize(settings);
    image.Depth = 1;
    image.Write(@"C:\logo-3.png");
}
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.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>