Open-source CLI tool converts entire image folders to WebP with one command
A developer has released an open-source, MIT-licensed command-line tool called assetopt that converts entire folders of JPEG and PNG images to WebP format locally without uploading files to any external service. The tool is configured via a simple JSON file and mirrors the source directory structure while leaving original files untouched. WebP images are typically 25–35% smaller than equivalent JPEGs or PNGs, and tests on sample files showed savings ranging from 17% for JPEGs to nearly 90% for photos mistakenly saved as PNGs. The CLI also includes a dry-run analyze mode that reports before-and-after file sizes without writing any output, and an incremental cache ensures only changed files are re-encoded during quality tuning. The tool can be installed globally via npm or run without installation using npx, and also supports routing transparent PNGs to the AVIF format automatically.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in