From 78314a99eb7aa2d428a793639ca312151dbf0703 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 18 Dec 2016 11:44:04 +1100 Subject: [PATCH] Slight improvement in palette quantizer --- src/ImageSharp/Quantizers/Palette/PaletteQuantizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Quantizers/Palette/PaletteQuantizer.cs b/src/ImageSharp/Quantizers/Palette/PaletteQuantizer.cs index 6ca5d00fb..ee19d8c2b 100644 --- a/src/ImageSharp/Quantizers/Palette/PaletteQuantizer.cs +++ b/src/ImageSharp/Quantizers/Palette/PaletteQuantizer.cs @@ -27,7 +27,7 @@ namespace ImageSharp.Quantizers /// /// A lookup table for colors /// - private readonly Dictionary colorMap = new Dictionary(); + private readonly Dictionary colorMap = new Dictionary(); /// /// List of all colors in the palette @@ -76,7 +76,7 @@ namespace ImageSharp.Quantizers protected override byte QuantizePixel(TColor pixel) { byte colorIndex = 0; - int colorHash = pixel.GetHashCode(); + TPacked colorHash = pixel.PackedValue; // Check if the color is in the lookup table if (this.colorMap.ContainsKey(colorHash))