jpegoptim
$ jpegoptim Community Med Riskjpegoptim optimizes JPEG Huffman tables, strips EXIF/IPTC/ICC metadata (--strip-all), and optionally caps lossy recompression with --max=<quality>. It includes --noaction (-n) for dry-run inspection, --csv for machine-parseable batch metrics, and --dest to avoid in-place overwrites.
brew install jpegoptim Batch JPEG optimization and --noaction --csv size audits run directly in shell without MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --noaction (-n), --csv structured reports, --quiet, and --stdout, though lacks native --json.
- Provides
--noactiondry-run and--csvoutput flags - No native
--jsonflag
Dedicated --noaction dry-run and --dest= directory safeguard, but default invocation mutates source files in-place.
- Mutates input JPEGs in-place unless
--dest,--stdout, or--noactionis set
Lightweight C binary built on libjpeg, widely available via Homebrew and Linux repositories.
- Available via
brew install jpegoptimand distro packages
Fast lossless Huffman optimization plus optional --max ceiling that avoids re-encoding already-low-quality JPEGs.
--maxonly recompresses JPEGs exceeding the target quality threshold
Maintained by Timo Kokkonen (tjko/jpegoptim) over many years.
- Active
tjko/jpegoptimGitHub repository
Concise --help and man page detailing --strip-* and --threshold options.
- Standard
--helpand man page documentation
Security, Auth & Guardrails
None required; operates on local JPEG files or stdin/stdout.
Free GPL-2.0-or-later open-source C binary.
# jpegoptim Agent Rules - Always run `jpegoptim --noaction --csv` first to preview savings. - Pass `--dest=<dir>` (or `--stdout`) because `jpegoptim` overwrites source JPEGs in-place by default. - Avoid `--strip-all` if ICC color profiles or copyright/orientation tags must be preserved.
Agent-Ready Command Recipes
Safe Read-Only Queries
jpegoptim --noaction --csv --max=85 *.jpg
Simulates optimization and outputs CSV before/after sizes without modifying any JPEG.
Controlled Writes & Previews
jpegoptim --max=85 --strip-all --dest=out_jpgs *.jpg
Recompresses JPEGs capped at quality 85, strips metadata, and writes copies to out_jpgs/.
Strengths for Agents
- +
--noaction --csvgives agents structured size-savings previews without touching disk. - +
--max=85avoids needlessly re-encoding JPEGs that are already compressed below quality 85.
Caveats & Pitfalls
- ! Overwrites input JPEGs in-place unless
--dest=<dir>or--stdoutis explicitly supplied. - !
--strip-allremoves ICC profiles and EXIF orientation along with sensitive GPS/camera tags.