Processing images for a website

I always seem to forget the best options for converting eg a photo I’ve taken - or downloaded from Unsplash - for use on a website. Here’s a reminder, based on general experience and also the answers and notes for this StackOverflow question. The basic answer is:

  1. Crop if necessary, so the image is the right aspect ratio (GIMP does this fine)
  2. Use imagemagick to compress etc, with a command like:
convert input-image.jpg -sampling-factor 4:2:0 -strip -quality 85 -resize 800 \
-interlace JPEG -colorspace RGB output.jpg

You'll only receive email when 12387 publishes a new post

More from 12387