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

cwebp

$ cwebp Official Low Risk
Google · AI & Media · BSD-3-Clause · macos / linux / windows

Google's official libwebp CLI suite centers on cwebp for encoding PNG/JPEG/TIFF images to lossy or lossless WebP, paired with dwebp for decoding, webpmux for animations/ICC/EXIF muxing, and webpinfo for inspecting WebP RIFF chunks.

FCRS-1.0 Score
84 /100
Good
High Confidence
Zero-Friction Install
brew install webp
CLI vs MCP Decision CLI Only

Encoding web assets to WebP and checking RIFF headers via webpinfo is strictly local and needs no MCP.

Agent-Readiness Checklist

Local Probe Evidence
— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md
Version
1.6.0
Startup
4 ms
Exit Codes (help / invalid)
1 / 1
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
Usage:
 cwebp [-preset <...>] [options] in_file [-o out_file]

If input size (-s) for an image is not specified, it is
assumed to be a PNG, JPEG, TIFF or WebP file.
Note: Animated PNG and WebP files are not supported.

Options:
  -h / -help ............. short help
  -H / -longhelp ......... long help
  -q <float> ............. quality factor (0:small..100:big), default=75
  -alpha_q <int> ......... transparency-compression quality (0..100),
                           default=100
  -preset <string> ....... preset setting, one of:
                            default, photo, picture,
                            drawing, icon, text
     -preset must come first, as it overwrites other parameters
  -z <int> ............... activates lossless preset with given
                           level in [0:fast, ..., 9:slowest]

  -m <int> ............... compression method (0=fast, 6=slowest), default=4
  -segments <int> ........ number of segments to use (1..4), default=4
  -size <int> ............ target size (in bytes)
  -psnr <float> .......... target PSNR (in dB. typically: 42)

  -s <int> <int> ......... input size (width x height) for YUV
  -sns <int> ............. spatial noise shaping (0:off, 100:max), default=50
  -f <int> ............... filter strength (0=off..100), default=60
  -sharpness <int> ....... filter sharpness (0:most .. 7:least sharp), default=0
  -strong ................ use strong filter instead of simple (default)
  -nostrong .............. use simple filter instead of strong
  -sharp_yuv ............. use sharper (and slower) RGB->YUV conversion
  -partition_limit <int> . limit quality to fit the 512k limit on
                           the first partition (0=no degradation ... 100=full)
  -pass <int> ............ analysis pass number (1..10)
  -qrange <min> <max> .... specifies the permissible quality range
                           (default: 0 100)
  -crop <x> <y> <w> <h> .. crop picture with the given rectangle
  -resize <w> <h> ........ resize picture (*after* any cropping)
  -resize_mode <string> .. one of: up_only, down_only, always (default)
  -mt .................... use multi-threading if available
  -low_memory ............ reduce memory usage (slower encoding)
  -map <int> ............. print map of extra info
  -print_psnr ............ prints averaged PSNR distortion
  -print_ssim ............ prints averaged SSIM distortion
  -print_lsim ............ prints local-similarity distortion
  -d <file.pgm> .......... dump the compress

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Deterministic non-interactive CLI with -quiet, -o - stdout support, and -longhelp, though no JSON output or --dry-run.

  • Supports -quiet, -o -, and -longhelp
  • No JSON output or --dry-run
Trust & Safety 22 / 25

Requires separate -o output path so source files are never mutated in-place, and webpinfo provides read-only inspection.

  • Non-destructive to source images; webpinfo is read-only
Setup & Portability 14 / 15

Prebuilt Google binaries and packages across Homebrew (webp), Linux, and Windows.

  • Available via brew install webp and official Google downloads
Utility & Efficiency 13 / 15

Reference WebP encoder supporting lossy, -lossless, -resize, -crop, and -metadata control.

  • Official libwebp encoder with full codec tuning
Maintenance & Lineage 9 / 10

Official Google libwebp reference tools under permissive BSD-3-Clause license.

  • Maintained by Google WebP team
Docs & Verifiability 8 / 10

Clear Google Developers manual and -h/-longhelp flag documentation.

  • Documented at developers.google.com/speed/webp/docs/cwebp

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates on local image files or stdio (-o -).

Side Effects
Read-Only Local Write
Cost & Quotas

Free BSD-3-Clause open-source binary suite from Google.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# cwebp (WebP) Agent Rules
- Always pass `-o <output.webp>` and `-quiet` on `cwebp` so stderr stats do not pollute logs.
- Remember `cwebp` writes to a separate `-o` file and never modifies input PNG/JPEG files; use `-lossless` for UI screenshots and diagrams.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect WebP chunks and frame summary
webpinfo -summary image.webp

Reads WebP RIFF structure, alpha/animation flags, and dimensions without modifying the file.

Controlled Writes & Previews

Encode PNG to lossy WebP with quiet output
cwebp -quiet -q 80 input.png -o output.webp

Converts input.png to output.webp at quality 80 while suppressing progress chatter.

Strengths for Agents

  • + Official Google reference encoder with -lossless, -near_lossless, and -quiet modes.
  • + Bundled webpinfo -summary and dwebp cover inspection and decoding cleanly.

Caveats & Pitfalls

  • ! Does not accept animated GIF directly (gif2webp is required for GIF-to-WebP).
  • ! Uses single-dash flags (-quiet, -lossless) and lacks --no-overwrite or JSON output.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI