Repository navigation
Image Optimizer 2.1 — Now in Your Terminal
Image Optimizer now ships with imgopt, a command line tool that uses the same bundled optimizers as the app. Script your image pipeline, optimize a folder before a commit, or just stay in the terminal. No Node.js or extra installs needed.
Get the Command
- macOS: choose Image Optimizer → Install Command Line Tool… to add
imgoptto/usr/local/bin. Move the app to Applications first. - Windows: the installer adds
imgoptto your userPATH. Open a new terminal after installing.
The app doesn't need to be running for the command to work.
A Guided Mode for When You Don't Remember the Flags
Run imgopt on its own. It asks what to optimize, where the results should go, whether to convert to WebP, which quality to use, and whether to keep metadata. Before it starts, it prints the equivalent command so you can skip the questions next time.
imgopt # guided mode
imgopt ./images # writes to ./images/minified
imgopt photo.jpg --webp -s # writes minified/photo.min.webp
imgopt ./assets --in-place -y # replace originals without asking
imgopt ./images --json # machine-readable reportSafe by Default
- Replacing original files asks for confirmation in the terminal and requires
--yesin scripts and CI. - Clear exit codes:
1when any file fails,2on invalid arguments,130when you decline or cancel. - A progress bar in the terminal, and plain output when piped.
Also in This Release
- Default PNG quality is now 85 for new installs. Existing settings are kept.
Run imgopt --help for all options.
What's Changed
- feat(cli): add imgopt command line tool by @antonreshetov in #40
Full Changelog: v2.0.2...v2.1.0