diff --git a/src/ImageSharp/Formats/WebP/Lossless/HistogramEncoder.cs b/src/ImageSharp/Formats/WebP/Lossless/HistogramEncoder.cs index 324a2848b4..a1ca4108ab 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/HistogramEncoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/HistogramEncoder.cs @@ -68,9 +68,11 @@ namespace SixLabors.ImageSharp.Formats.WebP.Lossless // Cubic ramp between 1 and MaxHistoGreedy: int thresholdSize = (int)(1 + (x * x * x * (MaxHistoGreedy - 1))); + RemoveEmptyHistograms(imageHisto); bool doGreedy = HistogramCombineStochastic(imageHisto, thresholdSize); if (doGreedy) { + RemoveEmptyHistograms(imageHisto); HistogramCombineGreedy(imageHisto); }