Put your files
on a diet.
The honest way to shrink a file. Shrink PDFs, images, and whole folders under a size limit — on your machine, safe by default, with an honest before/after receipt. One command, or an engine you embed.
npx onadiet report.pdf
--to 5mb
roadshow-deck.pdf
balanced
Slim a photo yourself — on your device, nothing uploaded.
Drop in an image and pick a plan. It re-encodes right here in your browser, held to a measured SSIM floor — and the gauge proves your file never leaves this tab. No server, no account, nothing sent.
Every fetch and XHR on this page is instrumented live — while onadiet slims your photo, both stay at zero. The work happens in your browser; the file never leaves this tab.
This is just a taste. A browser can only shrink efficiently by re-encoding to WebP, so that's what runs here — held to onadiet's real SSIM floor (both images decoded, luma 8×8), measured live, never estimated. The real deal is the library: it encodes with best-in-class codecs — mozjpeg, WebP, and AVIF (which browsers can't encode) — and it can keep your original format (a PNG stays a PNG, a JPEG a JPEG) or switch to a smaller one when that wins, plus it does PDFs and whole folders. Download the open-source library → Same promise everywhere: nothing is uploaded.
Real files. Real savings. Every number measured on the output.
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 | |
| lowcarb | SSIM 0.96 | 8.1 MB | |
| balanced | SSIM 0.90 | 4.8 MB | |
| keto | SSIM 0.80 | 3.7 MB | |
| crash | floorless | 3.3 MB |
Images too: a real photo (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.
Pick how hard to cut — from a lossless cleanse to a crash diet.
Quality is a contract, not a guess. Every plan holds a measured perceptual floor (SSIM), so lowcarb stays visually lossless and only crash accepts visible loss.
An engine for your hot path.
The same engine behind diet is an importable library (@onadiet/core + adapters). It holds no cross-call state, so a server can slim on every request — with a worker-offload pattern to keep your event loop free.
One verb. Everything smaller.
onadiet starts with files — but it's one honest, measured engine, and the vision is a franchise: put your X on a diet. Files ship today; the rest is the roadmap — same rules, always (local, measured, keeps your original).
Files
PDF · images · SVG · folders
Tables
Docker images
Repos
Models
Tokens
No uploads, no guesswork.
The alternatives are a stranger's upload form or a pile of memorized Ghostscript flags. onadiet is neither.
Local, no upload
It's your file; it stays your file. No account, no cloud, no network calls — nothing leaves your machine.
Safe by default
Never overwrites your original, never writes a bigger file, writes atomically — and refuses to silently break a signed or form PDF.
Measured, never faked
It verifies every result, holds a quality floor, and keeps your original if it can't honestly beat it. A saving it didn't measure is a bug.
One command. The metaphor is the vocabulary.
| diet report.pdf --to 5mb | Hit a goal weight — slim under 5 MB, holding the quality floor. |
| diet ./photos --to-total 25mb | Put a whole folder under a budget, structure preserved. |
| diet weigh brochure.pdf | Step on the scale — what does it weigh, what's heavy? No changes. |
| diet check ./public --max 2mb | CI weigh-in — pass/fail a budget with honest exit codes. |
| diet checkup | Is the kitchen stocked? Which codecs/engines are available. |
Everything speaks --json for scripts and agents. See the full usage & API reference — every command, flag, and the four ways to run onadiet.
Weigh in.
On npm now — built and proven against real files. One line to install:
npm i -g onadiet