Optimise the images
Install
MAC
brew install jpegoptim
Ubuntu
apt install jpegoptim
Usage
Go to the directory
jpegoptim -m80 --strip-all ../<current directory>/*
use to resize images, use in combination with compression
install
MAC
brew install imagemagick
Ubuntu
apt install imagemagick
usages
convert <image in name> -resize '500x>' -define jpeg:extent=50KB <image out name>
pngquant --quality=65-85 --speed 1 --force --verbose ../img-opti/*
#!/bin/bash
shopt -s nullglob
shopt -s nocaseglob
for f in *.jpg; do
convert "$f" -resize '500x>' -define jpeg:extent=50KB "$f"
done