Skip to content

Commit 30b929f

Browse files
authored
Add files via upload
1 parent c8f1a78 commit 30b929f

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

nQuantCpp/GilbertCurve.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace Peano
130130
c2 = BlueNoise::diffuse(pixel, m_pPalette[qPixelIndex], beta / m_saliencies[bidx], strength, x, y);
131131
}
132132

133-
if (m_nMaxColor < 3 || margin > 6) {
133+
if (margin > 6 || (m_nMaxColor <= 32 && m_weight > .007)) {
134134
if (m_nMaxColor > 4 && CIELABConvertor::Y_Diff(pixel, c2) > (beta * acceptedDiff)) {
135135
auto kappa = m_saliencies[bidx] < .4f ? beta * .4f * m_saliencies[bidx] : beta * .4f / m_saliencies[bidx];
136136
Color c1 = Color::MakeARGB(a_pix, r_pix, g_pix, b_pix);
@@ -378,9 +378,7 @@ namespace Peano
378378
beta *= .4f;
379379
if (m_nMaxColor > 64 && weight < .02)
380380
beta = .2f;
381-
else if (m_nMaxColor < 64 && weight < .0008)
382-
beta = 2.5f;
383-
else if (m_nMaxColor > 32 && weight < .015)
381+
else if (m_nMaxColor > 32 && m_nMaxColor < 64 && weight < .015)
384382
beta = .55f;
385383

386384
DITHER_MAX = weight < .015 ? (weight > .0025) ? (BYTE)25 : 16 : 9;

nQuantCpp/PnnLABQuantizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace PnnLABQuant
223223
}
224224
bins[j].cnt = quanFn(bins[j].cnt);
225225

226-
const bool texicab = proportional > .0225;
226+
const bool texicab = proportional > .0225 && !hasSemiTransparency;
227227

228228
if (!isGA) {
229229
if (hasSemiTransparency)

0 commit comments

Comments
 (0)