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

New Post: Jpg to Black and white TIFF with FloydSteinberg dithering

$
0
0
I have problems converting some jpg to black and white TIFF using FloydSteinberg dithering.
Some (for example santa.jpg ) becomes completely white.
My code is based on the example in this thread.
using (MagickImage image = new MagickImage(@"C:\santa.jpg"))
{
    QuantizeSettings settings = new QuantizeSettings();
    settings.DitherMethod = DitherMethod.FloydSteinberg;
    settings.ColorSpace = ColorSpace.Gray;
    settings.Colors = 2;
    image.Quantize(settings);
    image.Depth = 1;
    image.Write(@"C:\santa.tif");
}
Should this work or have I missed something?
(Using Magick.NET 7.0.0.0022 installed with NuGet)

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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