The web set.
AVIF + WebP at three widths, with a manifest and picture snippets.
pixelpress "assets/**/*.{jpg,png}" -o dist -r \
--preset web \
--manifest dist/images.json \
--picture dist/picture.html --public-path /images
Start from a real recipe. The builder writes the CLI, the Node API, and the config file for the same job.
The example input is public/images/**/*.{jpg,png}. Change the path in the generated code. Report is CLI-only.
Small commands, complete output. Every recipe can be combined with the cache, report, and manifest options.
AVIF + WebP at three widths, with a manifest and picture snippets.
pixelpress "assets/**/*.{jpg,png}" -o dist -r \
--preset web \
--manifest dist/images.json \
--picture dist/picture.html --public-path /images
1200×630 cover crop, JPEG + WebP, and a local report to check the crop.
pixelpress og-source.jpg -o social \ --preset social \ --report social/report.html
A 400px WebP thumbnail tree with hashed filenames for immutable caching.
pixelpress products -o dist/thumbs -r \ --preset thumb --hash --cache --prune
Quality searches down per variant. If quality 1 cannot fit, the file is reported as failed.
pixelpress hero.jpg -o dist \ -f avif,webp -q avif=70,webp=85 \ --max-bytes 120kb
WebP output preserves animation. Use it before static AVIF/JPEG fallbacks in <picture>.
pixelpress loop.gif -o dist \ -f webp -w 320,640 --hash
Cache makes reruns cheap; prune removes retired widths and deleted sources; watch keeps going.
pixelpress public/images -o dist -r \ --preset web --cache --prune --watch
Everything a template or review needs, from one run.
pixelpress photos -o dist -r \ --preset web --lqip \ --manifest dist/images.json \ --picture dist/picture.html --public-path /images \ --report dist/report.html
One image in, one image out. Logs stay on stderr.
cat photo.jpg \ | pixelpress - -f webp --width 1200 --stdout \ > photo.webp
Scaffold a config, edit the paths, and run with no arguments.
pixelpress --init # edit pixelpress.config.json pixelpress
Same options, absolute result paths, explicit failures.
import { optimize } from 'pixelpress';
const report = await optimize(['public/images'], {
outDir: 'dist/images',
preset: 'web',
cache: true,
prune: true,
});
if (report.failed.length) process.exitCode = 1;
Mirror the source tree, append width and hash suffixes, and keep format subdirectories out of the way. Every path in a manifest is relative to the directory you ran from.
dist/
images/
hero-480.avif
hero-480.webp
hero-960.avif
hero-960.webp
team/
ana-480.avif
ana-480.webp
images.json
picture.html
report.html
Copy a recipe, change the paths, and run it. The CLI and API are waiting.