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 Sep 8, 2024
1 parent b20caaa commit 9fed603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions nQuantGpp/GilbertCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,10 @@ namespace Peano
m_saliencies = saliencies;
m_getColorIndexFn = getColorIndexFn;
auto hasAlpha = weight < 0;
sortedByYDiff = !hasAlpha && m_saliencies && nMaxColors >= 128 && weight >= .052;
weight = abs(weight);
margin = weight < .0025 ? 12 : 6;

nMaxColors = palette.cols * palette.rows;
sortedByYDiff = !hasAlpha && m_saliencies && nMaxColors >= 128 && weight >= .052;
DITHER_MAX = weight < .01 ? (weight > .0025) ? (uchar)25 : 16 : 9;
auto edge = hasAlpha ? 1 : exp(weight) + .25;
auto deviation = weight > .002 ? .25 : 1;
Expand Down
2 changes: 1 addition & 1 deletion nQuantGpp/PnnLABQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ namespace PnnLABQuant
palette.at<Vec3b>(1, 0) = Vec3b(UCHAR_MAX, UCHAR_MAX, UCHAR_MAX);
}

if (hasSemiTransparency)
if (hasSemiTransparency || isGA)
weight *= -1;

auto GetColorIndex = [&](const Vec4b& c) -> int {
Expand Down

0 comments on commit 9fed603

Please sign in to comment.