Automagically optimizes images in a directory (optionally recursively) with a given compression level and criteria for replacement.
Go to file
Your Name 03fa819716 initial commit 2022-02-01 10:34:41 -05:00
.gitignore initial commit 2022-02-01 10:34:41 -05:00
README.md initial commit 2022-02-01 10:34:41 -05:00
go.mod initial commit 2022-02-01 10:34:41 -05:00
main.go initial commit 2022-02-01 10:34:41 -05:00

README.md

imageoptimizer

imageoptimizer is a tool for bulk compression og JPG images. It will re-compress original images and replace them if the savings is more than the requested percentage difference, default is 25%. By defaul it operated in a "dry run" mode where images are not replaced but individual and total savings are reported at the end, unless you supply the '-replace' flag.

usage

Recursively check all images starting from the current path. Calculate actions and total svings but don't make any changes.

imageoptimizer -recursive -compresslevel 85 -diff 25

Replace images in the current path with a compressed version if compressing at 80% reduces file size by at least 30%

imageoptimizer -compresslevel --replace --diff 30