pngquant 您所在的位置:网站首页 images/omamori_myoji_button.png pngquant

pngquant

2023-03-09 19:12| 来源: 网络整理| 查看: 265

Algorithm

pngquant uses modified version of Median Cut quantization algorithm and additional techniques to mitigate deficiencies of Median Cut.

Instead of splitting boxes with largest volume or number of colors, boxes are selected to minimize variance from their median value.

Histogram is built with addition of a basic perception model, which gives less weight to noisy areas of the image.

To improve color further, histogram is adjusted in a process similar to gradient descent (Median Cut is repeated many times with more weight on poorly represented colors).

Finally, colors are corrected using Voronoi iteration (K-means), which guarantees locally optimal palette.

pngquant works in premultiplied alpha color space to give less weight to transparent colors.

When remapping, error diffusion is applied only to areas where several neighboring pixels quantize to the same value, and which are not edges. This avoids adding noise to areas which have high visual quality without dithering.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有