imageoptimizer/README.md

29 lines
1.3 KiB
Markdown
Raw Normal View History

2022-02-01 15:34:41 +00:00
# imageoptimizer
imageoptimizer is a tool for bulk compression og JPG images. It will re-compress original images and replace them if the savings is
2022-02-02 16:37:47 +00:00
more than the requested percentage difference and optionally if the original file is bigger than a cefrtain size. You can also
set a maximum resolution for images and they will be rescaled if they exceed it, however they are only replaced if they meet the size
difference requirement set.
By default it operates 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.
2022-02-01 15:34:41 +00:00
# why?
Poorly optimized images in most contexts waste space and bandwidth unnecessarily. JPEG compression was designed to highly optimize photos with
little or no visually identifiable differences in default conditions, and for scenarios where absolute quality is less important it can compress
even farther. Generally quality levels below 75 are where you start to notice a difference.
2022-02-01 15:34:41 +00:00
# usage
Recursively check all images starting from the current path. Calculate actions and total svings but don't make any changes.
```
imageoptimizer -recursive -diff 25
2022-02-01 15:34:41 +00:00
```
Replace images in the current path with a compressed version if compressing at 80% quality reduces file size by at least 30%
2022-02-01 15:34:41 +00:00
```
imageoptimizer -quality 80 --replace --diff 30
2022-02-01 15:34:41 +00:00
```