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 13, 2024
1 parent 24cfdd5 commit 4eaabb3
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 @@ -127,7 +127,7 @@ namespace Peano
m_lookup[offset] = m_ditherFn(m_pPalette, m_nMaxColor, c2.GetValue(), bidx) + 1;
qPixelIndex = m_lookup[offset] - 1;

if (m_saliencies != nullptr && CIELABConvertor::Y_Diff(pixel, c2) > m_nMaxColor - margin) {
if (m_saliencies != nullptr && CIELABConvertor::Y_Diff(pixel, c2) > max(1, m_nMaxColor - margin)) {
auto strength = 1 / 3.0f;
c2 = BlueNoise::diffuse(pixel, m_pPalette[qPixelIndex], 1.0f / m_saliencies[bidx], strength, x, y);
qPixelIndex = m_ditherFn(m_pPalette, m_nMaxColor, c2.GetValue(), bidx);
Expand Down

0 comments on commit 4eaabb3

Please sign in to comment.