@@ -557,23 +557,6 @@ namespace PnnLABQuant
557557 return closest[idx];
558558 }
559559
560- bool PnnLABQuantizer::quantize_image (const ARGB * pixels, const ARGB * pPalette, const UINT nMaxColors, unsigned short * qPixels, const UINT width, const UINT height, const bool dither)
561- {
562- auto NearestColorIndex = [this , nMaxColors](const ARGB * pPalette, const UINT nMaxColors, ARGB argb, const UINT pos) -> unsigned short {
563- return closestColorIndex (pPalette, nMaxColors, argb, pos);
564- };
565-
566- if (dither)
567- return dither_image (pixels, pPalette, nMaxColors, NearestColorIndex, hasSemiTransparency, m_transparentPixelIndex, qPixels, width, height);
568-
569- UINT pixelIndex = 0 ;
570- for (int j = 0 ; j < height; ++j) {
571- for (int i = 0 ; i < width; ++i)
572- qPixels[pixelIndex++] = NearestColorIndex (pPalette, nMaxColors, pixels[pixelIndex], i + j);
573- }
574- return true ;
575- }
576-
577560 void PnnLABQuantizer::clear ()
578561 {
579562 saliencies.clear ();
@@ -627,7 +610,7 @@ namespace PnnLABQuant
627610 auto NearestColorIndex = [this , nMaxColors](const ARGB * pPalette, const UINT nMaxColors, ARGB argb, const UINT pos) -> unsigned short {
628611 if (nMaxColors <= 4 )
629612 return nearestColorIndex (pPalette, nMaxColors, argb, pos);
630- if (IsGA () && nMaxColors < 16 )
613+ if (weight < . 0005 && nMaxColors < 16 )
631614 return hybridColorIndex (pPalette, nMaxColors, argb, pos);
632615 return closestColorIndex (pPalette, nMaxColors, argb, pos);
633616 };
0 commit comments