why onadiet · local · honest · one tool

No uploads.
No guesswork.
Just smaller.

Every other way to shrink a file asks you to hand it to a stranger's server, or to memorize a pile of Ghostscript flags. onadiet is neither: 100% local, it hits a target size (--to 5mb, not just "compress"), one tool for PDFs, images, and folders — with an honest measured before/after receipt held to a quality floor. Free and open-source, Apache-2.0.

npx onadiet report.pdf --to 5mb
Try the live demo →
🔒 100% local — no network calls Free & open-source — Apache-2.0 📏 Measured, never estimated
The differentiators

What makes onadiet different.

The alternatives are excellent at their one thing (we concede exactly where, below) — but no other tool does all of this at once, locally, with numbers it actually measured.

100% local, no upload

Nothing is uploaded — no account, no cloud, no network calls. Your file never leaves your machine, and the live demo's gauge proves every fetch/XHR stays at zero.

Hits a target size

Ask for a goal weight — --to 5mb — not just "compress". onadiet runs a size search to land under the limit while holding the quality floor, or refuses honestly instead of returning garbage.

One tool, every format

PDFs, images, SVGs, and whole folders — one command, one library. diet ./photos --to-total 25mb puts a directory under a budget with the structure preserved.

Honest measured receipt

Every saving is measured on the output and held to a perceptual floor (SSIM). It reports the real delta and the codec it chose — or keeps your original. A saving it didn't measure is a bug.

An embeddable engine

The same engine imports as @onadiet/core — embed it on a server hot path (~9× lower per-call latency with --fast), gate CI with diet check, or wrap it as an agent Skill.

Safe by default

Never overwrites your original, never writes a bigger file, writes atomically — and refuses to silently break a signed or form PDF rather than corrupt it.

Head to head

onadiet vs. the usual suspects.

An honest matrix — where each tool wins is called out right after it. onadiet's column is highlighted; every ✓ here is something it actually ships today.

Capability onadietlocal CLI + library TinyPNGweb / API SquooshGoogle web app ImageOptimMac app GhostscriptCLI flags
Runs locally · nothing uploaded your file stays on your machine uploads to their servers in-browser
Hit a target file size --to 5mb, not just "compress" size search one-shot manual sliders trial & error
PDFs + images + folders — one tool not five separate tools ~ images; PDF is a separate paid product ~ one image at a time ~ images only ~ PDFs; images via flags
Honest measured receipt + quality floor real before/after, held to SSIM
Safe by default never overwrite / never bigger; refuses signed PDFs manual save edits in place you manage paths
Embeddable library · CI gate · scriptable import it, or fail a build on budget ~ paid API ~ scriptable via flags
Free & open-source no paywall, inspectable Apache-2.0 ~ freemium / paid API AGPL

Where they shine — honestly. TinyPNG's PNG quantization and clean API are genuinely excellent. Squoosh is a lovely, free in-browser tool with superb manual codec controls. ImageOptim is a delightful drag-and-drop Mac GUI. And Ghostscript is battle-tested and immensely powerful. onadiet's angle is different: a target-size search, one tool across PDFs, images, and folders, honest measured receipts held to an SSIM floor, fully local, embeddable on a hot path, and safe by default.

Measured, not promised

Real files. Real savings. Every number measured on the output.

These are the same figures from the home page's benchmarks — proven against a genuinely public 9 MB SpaceX IPO-roadshow deck (60 pages, 224 images) in the golden-corpus test suite. Ask for a plan, or a target size — if it can't hit the target above the quality floor, it refuses honestly instead of returning garbage.

Plan Quality floor 9.0 MB → Reduction
cleanse lossless 9.0 MB
0%
lowcarb SSIM 0.96 8.1 MB
~10%
balanced SSIM 0.90 4.8 MB
~47%
keto SSIM 0.80 3.7 MB
~59%
crash floorless 3.3 MB
~64%

Images too: a real photo (a NASA public-domain image, JPEG) → ~55% smaller at SSIM 0.94; a flat graphic (PNG) → 8 KB, ~99% smaller via an automatic switch to AVIF. Every figure is reproducible with pnpm run test:perf — no estimates.

Weigh in.

On npm now — early and 0.x, built and proven against real files. Install it globally, or run it once with npx.

npm i -g onadiet
npx onadiet report.pdf --to 5mb