From 7c97634bcbd5812b514e39a325f548a2fc131ebf Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Fri, 12 Feb 2021 12:54:16 +0100 Subject: [PATCH] Change BinaryDither to FloydSteinberg --- src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs b/src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs index 76d5cbaa0..5db0eff73 100644 --- a/src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs +++ b/src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs @@ -3,12 +3,12 @@ using System; using System.Buffers; + using SixLabors.ImageSharp.Formats.Experimental.Tiff.Compression; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Metadata; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors.Dithering; namespace SixLabors.ImageSharp.Formats.Experimental.Tiff.Writers { @@ -27,11 +27,13 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff.Writers // Convert image to black and white. // TODO: Should we allow to skip this by the user, if its known to be black and white already? this.imageBlackWhite = new Image(configuration, new ImageMetadata(), new[] { image.Clone() }); - this.imageBlackWhite.Mutate(img => img.BinaryDither(default(ErrorDither))); + this.imageBlackWhite.Mutate(img => img.BinaryDither(KnownDitherings.FloydSteinberg)); } + /// public override int BitsPerPixel => 1; + /// protected override void EncodeStrip(int y, int height, TiffBaseCompressor compressor) { if (this.pixelsAsGray == null) @@ -89,6 +91,7 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff.Writers } } + /// protected override void Dispose(bool disposing) { this.imageBlackWhite?.Dispose();