本帖最後由 hihihi123hk 於 2015-4-1 02:02 編輯
網上上傳圖片,再下載,其實唔關程式編寫事
有人話睇到壓咗有唔同,叫我唔好用。想求證。我的相好似header ...
chimp 發表於 2015-3-31 11:22 
識用一定係用呢隻 http://pngquant.org/ 既CLI 自己慢慢tune
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. |