@@ -113,7 +113,8 @@ namespace Peano
113113 if (m_nMaxColor <= 4 && m_saliencies[bidx] > .2f && m_saliencies[bidx] < .25f )
114114 c2 = BlueNoise::diffuse (pixel, m_pPalette[qPixelIndex], beta * 2 / m_saliencies[bidx], strength, x, y);
115115 else if (m_nMaxColor <= 4 || CIELABConvertor::Y_Diff (pixel, c2) < (2 * acceptedDiff)) {
116- c2 = BlueNoise::diffuse (pixel, m_pPalette[qPixelIndex], beta * .5f / m_saliencies[bidx], strength, x, y);
116+ if (m_nMaxColor <= 128 || BlueNoise::TELL_BLUE_NOISE [bidx & 4095 ] > 0 )
117+ c2 = BlueNoise::diffuse (pixel, m_pPalette[qPixelIndex], beta * .5f / m_saliencies[bidx], strength, x, y);
117118 if (m_nMaxColor <= 4 && CIELABConvertor::U_Diff (pixel, c2) > (8 * acceptedDiff)) {
118119 Color c1 = m_saliencies[bidx] > .65f ? pixel : Color::MakeARGB (a_pix, r_pix, g_pix, b_pix);
119120 c2 = BlueNoise::diffuse (c1, m_pPalette[qPixelIndex], beta * m_saliencies[bidx], strength, x, y);
@@ -346,7 +347,7 @@ namespace Peano
346347
347348 if (m_nMaxColor > 64 || (m_nMaxColor > 4 && weight > .02 ))
348349 beta *= .4f ;
349- if (m_nMaxColor > 128 && weight < .02 )
350+ if (m_nMaxColor > 64 && weight < .02 )
350351 beta = .2f ;
351352
352353 DITHER_MAX = weight < .015 ? (weight > .0025 ) ? (BYTE )25 : 16 : 9 ;
0 commit comments