Ref:
https://developers.google.com/speed/docs/insights/OptimizeImages (Will be deprecated at May 2019) https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization
Use:
http://www.imagemagick.org/Usage/basics/#mogrify https://formulae.brew.sh/formula/imagemagick
brew update; brew install
jpg 壓成寬 1440
convert *.jpg -sampling-factor 4:2:0 -strip -resize 1440 -quality 85 -interlace JPEG -set filename:fname 'desktop-%t-%wx%h' +adjoin '%[filename:fname].jpg'
convert *.png -strip -resize 1440x960 -quality 60 -set filename:fname 'desktop-%t-%wx%h-fg' +adjoin '%[filename:fname].png'
壓 1024
convert *.jpg -sampling-factor 4:2:0 -strip -resize 1024 -quality 85 -interlace JPEG -set filename:fname 'tablet-%t-%wx%h' +adjoin '%[filename:fname].jpg'
convert *.png -strip -resize 1024x1024 -set filename:fname 'tablet-%t-%wx%h-fg' +adjoin '%[filename:fname].png'
壓 768
convert *.jpg -sampling-factor 4:2:0 -strip -resize 768 -quality 85 -interlace JPEG -set filename:fname 'mobile-%t-%wx%h' '%[filename:fname].jpg'
convert *.png -strip -resize 170x170 -set filename:fname '%t' 'compressed/%[filename:fname].png'
Use ffmpeg
: https://formulae.brew.sh/formula/ffmpeg
brew update; brew install ffmpeg
ffmpeg -i 05-work-early.mp3 -codec:a libmp3lame -b:a 128k m/05-work-early.mp3
ffmpeg -i 09-poisoned.mp3 -codec:a libmp3lame -b:a 128k m/09-poisoned.mp3
ffmpeg -i 12-about-salary.mp3 -codec:a libmp3lame -b:a 128k m/12-about-salary.mp3
ffmpeg -i 20-special.mp3 -codec:a libmp3lame -b:a 128k m/20-special.mp3
ffmpeg -i 24-future-ending.mp3 -codec:a libmp3lame -b:a 128k m/24-future-ending.mp3