From a0a82023ec0f130b346ab5328604552dcfd5ab26 Mon Sep 17 00:00:00 2001 From: Miller Cy Chan Date: Sat, 23 Sep 2023 13:05:19 +0800 Subject: [PATCH] Add files via upload --- nQuantGpp/GilbertCurve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nQuantGpp/GilbertCurve.cpp b/nQuantGpp/GilbertCurve.cpp index f8eddc6..c9bc330 100644 --- a/nQuantGpp/GilbertCurve.cpp +++ b/nQuantGpp/GilbertCurve.cpp @@ -195,8 +195,8 @@ namespace Peano nMaxColors = palette.cols * palette.rows; if (nMaxColors / weight > 5000 && (weight > .045 || (weight > .01 && nMaxColors <= 64))) ditherMax = (uchar)sqr(5 + edge); - else if (nMaxColors > 16 && nMaxColors < 256) - ditherMax = (nMaxColors / weight) < 3200 ? (uchar)sqr(5 + edge) : (uchar)sqr(3 + edge); + else if (nMaxColors / weight < 3200 && nMaxColors > 16 && nMaxColors < 256) + ditherMax = (uchar)sqr(5 + edge); thresold = DITHER_MAX > 9 ? -112 : -64; auto pWeights = make_unique(DITHER_MAX); m_weights = pWeights.get();