Oxipng
$ oxipng 社区开源 低风险Oxipng 是一款高速多线程 Rust 无损 PNG 与 APNG 压缩工具,可在不改变像素的前提下大幅缩减网页和应用资源体积。它提供 --dry-run(-d)预演、--out/--dir 非破坏性输出、--strip safe 安全元数据清理及 -q 静默模式。
brew install oxipng 具备 --dry-run 校验的本地资源压缩在 shell 中即可高速运行,无需 MCP。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
现代化的 Rust clap CLI,具备 --dry-run、--quiet、--stdout 与清晰退出码,但仅输出人类可读文本摘要而非 JSON。
- Supports
--dry-run,-q/--quiet, and--stdout - No
--jsonreport flag
无损保留像素,提供 --dry-run 预演、--out/--dir 防覆盖输出以及 --strip safe 与 --strip all 的精细区分。
- Dedicated
--dry-runprevents unwanted disk writes - Supports
--outand--dirto avoid in-place overwrites
单一 Rust 二进制,通过 Homebrew、Cargo、npm 包装器及 GitHub Releases 覆盖 macOS、Linux 与 Windows。
- Available via
brew install oxipng,cargo install oxipng, and releases
多线程 Zopfli/libdeflater 优化全面替代速度较慢的传统 optipng/pngcrush 流程。
- Parallelized PNG/APNG optimization across CPU cores
由 oxipng/oxipng 持续积极维护的 MIT 开源项目。
- Active
oxipng/oxipngrepository under MIT
结构化的 oxipng --help 与 README 清晰说明了优化等级(-o 0..6)与数据块清理选项。
- Clear clap-generated
--helpreference
安全边界、鉴权与放权指南
无需凭据;仅处理本地 PNG/APNG 文件或标准输入/输出。
免费,基于 MIT 协议的开源 Rust 二进制工具。
# Oxipng Agent Rules - Run `oxipng --dry-run` first to check expected savings before modifying repository assets. - Prefer `--out <file>` or `--dir <dir>` over in-place overwrites unless in-place asset optimization is intended; use `--strip safe` rather than `--strip all` to keep color profiles intact.
Agent 高频安全命令配方
只读查询(安全推荐)
oxipng -o 4 --dry-run assets/*.png
计算优化后的压缩流并报告可节省字节数,不修改任何文件。
受控写入与预演
oxipng -o 4 --strip safe --out optimized.png input.png
生成体积更小的无损 optimized.png,同时完整保留原文件 input.png。
核心优势
- + 原生
--dry-run与--out/--dir标志让自动化资源压缩安全且可验证。 - + 多线程 Rust 执行速度显著快于传统
optipng。
注意事项与踩坑点
- ! 若省略
--out、--dir或--dry-run,默认会就地覆盖输入文件。 - ! 仅输出人类可读摘要文本,不支持结构化 JSON。