Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Feb 5, 2024
1 parent 4b7047a commit eb3a2de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nQuantCpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace Peano
error.yDiff = sortedByYDiff ? CIELABConvertor::Y_Diff(pixel, c2) : 1;
auto illusion = !diffuse && BlueNoise::TELL_BLUE_NOISE[(int)(error.yDiff * 4096) & 4095] > thresold;
auto yDiff = 1.0;
if (m_saliencies == nullptr && DITHER_MAX > 9)
if (!m_saliencies && !sortedByYDiff)
yDiff = CIELABConvertor::Y_Diff(pixel, c2);

int errLength = denoise ? error.length() - 1 : 0;
Expand Down Expand Up @@ -240,7 +240,7 @@ namespace Peano
errorq.clear();
weight = abs(weight);
margin = weight < .0025 ? 12 : 6;
sortedByYDiff = !hasAlpha && pPalette->Count >= 128 && weight >= .04;
sortedByYDiff = !hasAlpha && m_saliencies && pPalette->Count >= 128 && weight >= .04;
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;
Expand Down

0 comments on commit eb3a2de

Please sign in to comment.