From 763fe8d61ffcb3bc653e006a4c63840f0e4a3c49 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 5 Jun 2021 13:40:35 +0100 Subject: [PATCH] Only create map when required in Wu --- .../Processors/Quantization/WuQuantizer{TPixel}.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs index b5d840f9dd..2d52eb746f 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs @@ -143,7 +143,11 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization } ReadOnlyMemory result = this.paletteOwner.Memory.Slice(0, paletteSpan.Length); - this.pixelMap = new EuclideanPixelMap(this.Configuration, result); + if (this.isDithering) + { + this.pixelMap = new EuclideanPixelMap(this.Configuration, result); + } + this.palette = result; }