As images continue to be the largest part of websites, it’s very important for website owners to take aggressive control of their image sizes. You need to hit the sweet-spot between website image quality and website image size.
You can usually automate a ‘good enough’ value, but for maximum file size savings, you need to test quality using your own eye.
This command below helps compress the file size of jpg images. Reduce the quality number to reduce the file size.
brew install imagemagick
mogrify -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB *.jpg
Note: this will overwrite your existing files, so make a backup first.