Other

项目介绍

kornelski/pngquant 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 Other 许可证,目前获得 5.8k 个 Star、508 次 Fork。

仓库全名
kornelski/pngquant
开源许可证
Other
Star 数
5.8k
Fork 数
508
未关闭 Issue
56

README 摘要

pngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems. This is the official pngquant repository. The compression engine is also available as an embeddable library. Usage…

完整内容见 GitHub 原始 README 或本页 。

常见问题

pngquant 用什么语言开发?

主要使用 C 编写,采用 Other 许可证,目前有 5.8k 个 Star。

pngquant 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 pngquant 的源码?

可以直接克隆仓库:git clone https://github.com/kornelski/pngquant.git,默认分支为 main;安装与运行步骤见仓库 README。

pngquant 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 56 个未关闭 Issue;Star 数为 5.8k,可作为社区活跃度的参考。

README

pngquant 3 CI

pngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems.

This is the official pngquant repository. The compression engine is also available as an embeddable library.

Usage

  • batch conversion of multiple files: pngquant *.png
  • Unix-style stdin/stdout chaining: … | pngquant - | …

To further reduce file size, try oxipng, ImageOptim, or zopflipng.

Features

  • High-quality palette generation
  • advanced quantization algorithm with support for gamma correction and premultiplied alpha
  • unique dithering algorithm that does not add unnecessary noise to the image
  • Configurable quality level
  • automatically finds required number of colors and can skip images which can’t be converted with the desired quality
  • Fast, modern code

Options

See pngquant -h for full list.

--quality min-max

min and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the max quality. If conversion results in quality below the min quality the image won’t be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99.

pngquant --quality=65-80 image.png

--ext new.png

Set custom extension (suffix) for output filename. By default -or8.png or -fs8.png is used. If you use --ext=.png --force options pngquant will overwrite input files in place (use with caution).

-o out.png or --output out.png

Writes converted file to the given path. When this option is used only single input file is allowed.

--skip-if-larger

Don’t write converted files if the conversion isn’t worth it.

--speed N

Speed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 4. It’s recommended to keep the default, unless you need to generate images in real time (e.g. map tiles). Higher speeds are fine with 256 colors, but don’t handle lower number of colors well.

--nofs

Disables Floyd-Steinberg dithering.

--floyd=0.5

Controls level of dithering (0 = none, 1 = full). Note that the = character is required.

--posterize bits

Reduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures in ARGB444 format).

--strip

Don’t copy optional PNG chunks. Metadata is always removed on Mac (when using Cocoa reader).

See man page (man pngquant) for the full list of options.

License

pngquant is dual-licensed:

评论

暂无评论