Last active
March 12, 2023 16:15
-
-
Save Phlow/d1e80574e7162748c2f1113acf2e78d0 to your computer and use it in GitHub Desktop.
Revisions
-
Phlow revised this gist
Mar 12, 2023 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,10 +11,17 @@ QUALITY=85 echo -e "\nGuetzli starts compression with quality ${QUALITY}…\n" for i in *.jpg; do cwebp -quiet -q 90 $i -o "${i%.*}.webp" new_size=$(stat -f%z $i) echo -e "\033[32mGenerate WEBP \033[33m› New size $new_size bytes – Saved bytes $(( ${old_size}-${new_size} ))" old_size=$(stat -f%z $i) echo -e "\033[32mMake copy for savety \033[1;32m$i \033[0;32moriginal-$i – \033[37mCopying…" cp $i original-$i; echo -e "\033[32mActual size of \033[1;32m$i \033[0;32m$old_size bytes – \033[37mGuetzli is working…" guetzli --quality $QUALITY $i $i new_size=$(stat -f%z $i) echo -e "\033[33mGuetzli JPG › New size $new_size bytes – Saved bytes $(( ${old_size}-${new_size} ))" echo -e "\033[0m" done for i in *.png; do cwebp -quiet -q 90 $i -o "${i%.*}.webp"; done -
Phlow created this gist
Feb 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/bash # # Guetzli JPG/JPEG Optimizer # This little script compresses JPG-files and shows you how # many bytes Guetzli saved you in the progress. Change the # variable QUALITY to change the quality of the compression. # clear QUALITY=85 echo -e "\nGuetzli starts compression with quality ${QUALITY}…\n" for i in *.jpg; do old_size=$(stat -f%z $i) echo -e "\033[32mActual size of \033[1;32m$i \033[0;32m$old_size bytes – \033[37mGuetzli is working…" guetzli --quality $QUALITY $i $i new_size=$(stat -f%z $i) echo -e "\033[33mNew size $new_size bytes – Saved bytes $(( ${old_size}-${new_size} ))" echo -e "\033[0m" done