Browse Source

Fix OctreeQuantizer

Create a new octree for each frame to prevent accumilations
af/merge-core
James Jackson-South 9 years ago
parent
commit
cac0007933
  1. 7
      src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs

7
src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs

@ -47,12 +47,7 @@ namespace ImageSharp.Quantizers
public override QuantizedImage<TColor> Quantize(ImageBase<TColor> image, int maxColors)
{
this.colors = maxColors.Clamp(1, 255);
if (this.octree == null)
{
// Construct the Octree
this.octree = new Octree(this.GetBitsNeededForColorDepth(maxColors));
}
this.octree = new Octree(this.GetBitsNeededForColorDepth(maxColors));
return base.Quantize(image, maxColors);
}

Loading…
Cancel
Save