diff --git a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs b/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs index 85cc8334f..dd10a040a 100644 --- a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs +++ b/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs @@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Quantization public IErrorDiffuser Diffuser { get; } /// - public IFrameQuantizer CreateFrameQuantizer() + public virtual IFrameQuantizer CreateFrameQuantizer() where TPixel : struct, IPixel => this.CreateFrameQuantizer(() => NamedColors.WebSafePalette); @@ -58,7 +58,7 @@ namespace SixLabors.ImageSharp.Processing.Quantization /// The pixel format. /// The method to return the palette. /// The - public virtual IFrameQuantizer CreateFrameQuantizer(Func paletteFunction) + public IFrameQuantizer CreateFrameQuantizer(Func paletteFunction) where TPixel : struct, IPixel => new PaletteFrameQuantizer(this, paletteFunction.Invoke());