Bash imagick convert google OptimizeImages multiple

June 3, 2017 13:27    imagickbash


https://developers.google.com/speed/docs/insights/OptimizeImages

Для JPG:

#!/bin/bash 
for f in *.jpg; do
convert ./"$f" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB ./"$f"
done

Для PNG

#!/bin/bash
for f in *.png; do
convert ./"$f" -strip ./"$f"
done