diff --git a/nQuantCpp/GilbertCurve.cpp b/nQuantCpp/GilbertCurve.cpp index 2e49f3c..62d6428 100644 --- a/nQuantCpp/GilbertCurve.cpp +++ b/nQuantCpp/GilbertCurve.cpp @@ -254,7 +254,8 @@ namespace Peano sortedByYDiff = !m_hasAlpha && m_saliencies && m_nMaxColor >= 128 && weight >= .042; DITHER_MAX = weight < .01 ? (weight > .0025) ? (BYTE)25 : 16 : 9; auto edge = m_hasAlpha ? 1 : exp(weight) + .25; - ditherMax = (m_hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge) : DITHER_MAX; + auto deviation = weight > .002 ? .25 : 1; + ditherMax = (m_hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge * deviation) : DITHER_MAX; int density = m_nMaxColor > 16 ? 3200 : 1500; if (m_nMaxColor / weight > 5000 && (weight > .045 || (weight > .01 && m_nMaxColor <= 64))) ditherMax = (BYTE)sqr(5 + edge);