Compress images for the web

Hand Coded Studio
Jul 10, 2017 · 1 min read

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.

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade