Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

pngquant

$ pngquant Community Low Risk
Kornel Lesinski · AI & Media · GPL-3.0-or-later (commercial license available) · macos / linux / windows

pngquant converts 24/32-bit RGBA PNGs into tiny 8-bit indexed-color PNGs while retaining smooth alpha transparency. It supports quality bounds (--quality=min-max), --skip-if-larger, stdin/stdout (-), and refuses to overwrite existing files unless --force is given.

FCRS-1.0 Score
81 /100
Good
Medium Confidence
Zero-Friction Install
brew install pngquant
CLI vs MCP Decision CLI Only

Palette quantization of PNG sprites and screenshots is a fast local binary step with no MCP utility.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Deterministic non-interactive CLI with stdin/stdout (-), --output, and semantic exit codes (98, 99), though lacks JSON output and --dry-run.

  • Non-interactive; supports --quality, --skip-if-larger, and - stdio
  • No JSON output or --dry-run
Trust & Safety 21 / 25

Refuses to overwrite existing files by default (writes *-fs8.png unless --force is passed) and respects --skip-if-larger.

  • Defaults to non-destructive -fs8.png suffix and rejects overwrites without --force
Setup & Portability 14 / 15

Tiny standalone C binary packaged on Homebrew, Linux distros, and Windows.

  • Available via brew install pngquant and OS package managers
Utility & Efficiency 13 / 15

Regularly achieves 60–80% PNG size reduction with minimal perceptual loss; pairs well before oxipng.

  • High-quality median-cut quantization preserving full alpha channel
Maintenance & Lineage 8 / 10

Mature project by Kornel Lesinski (kornelski/pngquant) backed by libimagequant.

  • Official kornelski/pngquant GitHub repository
Docs & Verifiability 7 / 10

Clear --help and man page explaining exit codes 98/99 and --speed presets.

  • Manual at pngquant.org and built-in --help

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates on local PNG files or stdin/stdout.

Side Effects
Local Write
Cost & Quotas

GPL-3.0-or-later open source; commercial license available for proprietary embedding.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# pngquant Agent Rules
- Expect exit code `98` (`--skip-if-larger` aborted) or `99` (below `--quality` minimum) as valid non-fatal outcomes rather than tool crashes.
- Specify `--output <path>` instead of `--force --ext .png` so original lossless PNGs are preserved.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect pngquant version and supported flags
pngquant --help

Prints CLI options, quality exit codes (98/99), and default suffix behavior without modifying files.

Controlled Writes & Previews

Quantize PNG with quality floor and size guard
pngquant --quality=65-80 --skip-if-larger --output out.png input.png

Writes out.png only if quality reaches 65+ and file size shrinks, leaving input.png untouched.

Strengths for Agents

  • + Safe-by-default naming (-fs8.png) prevents accidental overwrites unless --force is explicitly set.
  • + --skip-if-larger and --quality=min-max enforce automated quality/size guardrails.

Caveats & Pitfalls

  • ! Exit codes 98 (larger output skipped) and 99 (quality threshold unmet) trigger errors in naive set -e agent scripts.
  • ! Lossy quantization reduces colors to 256 per image; run oxipng when strict lossless output is required.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI