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 26, 2024
1 parent 8180082 commit fea181d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nQuantGpp/PnnLABGAQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ namespace PnnLABQuant
vector<shared_ptr<Mat> > imgList;
for(auto& pixels : m_pixelsList) {
vector<uchar> bytes;
auto pImg = make_shared<Mat>(m_pq->QuantizeImageByPal(*pixels, *palette, bytes, _nMaxColors, dither));
shared_ptr<Mat> pImg;
if(palette->rows > 256)
pImg = make_shared<Mat>(m_pq->QuantizeImage(*pixels, *palette, bytes, _nMaxColors, dither));
else
pImg = make_shared<Mat>(m_pq->QuantizeImageByPal(*pixels, *palette, bytes, _nMaxColors, dither));
bytesList.emplace_back(bytes);
if(imgList.empty() || (pImg->rows * pImg->cols) > _nMaxColors)
imgList.emplace_back(pImg);
Expand Down

0 comments on commit fea181d

Please sign in to comment.