Browse Source

Only create map when required in Wu

pull/1654/head
James Jackson-South 5 years ago
parent
commit
763fe8d61f
  1. 6
      src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs

6
src/ImageSharp/Processing/Processors/Quantization/WuQuantizer{TPixel}.cs

@ -143,7 +143,11 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization
} }
ReadOnlyMemory<TPixel> result = this.paletteOwner.Memory.Slice(0, paletteSpan.Length); ReadOnlyMemory<TPixel> result = this.paletteOwner.Memory.Slice(0, paletteSpan.Length);
this.pixelMap = new EuclideanPixelMap<TPixel>(this.Configuration, result); if (this.isDithering)
{
this.pixelMap = new EuclideanPixelMap<TPixel>(this.Configuration, result);
}
this.palette = result; this.palette = result;
} }

Loading…
Cancel
Save