Skip to content

Commit

Permalink
Update GilbertCurve.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored May 10, 2023
1 parent 5843305 commit a6e9d6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nQuantCpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ namespace Peano
DITHER_MAX = weight < .01 ? (weight > .0025) ? (BYTE)25 : 16 : 9;
auto edge = hasAlpha ? 1 : exp(weight) + .25;
ditherMax = (hasAlpha || DITHER_MAX > 9) ? (BYTE)sqr(_sqrt(DITHER_MAX) + edge) : DITHER_MAX;
if (pPalette->Count / weight > 5000 && weight > .01 && pPalette->Count >= 64)
if (pPalette->Count / weight > 5000 && (weight > .045 || (weight > .01 && pPalette->Count <= 64)))
ditherMax = (BYTE)sqr(4.75);
thresold = DITHER_MAX > 9 ? -112 : -88;
auto pWeights = make_unique<float[]>(DITHER_MAX);
Expand Down

0 comments on commit a6e9d6d

Please sign in to comment.