Just found out about this neat tool called imagemagick. I’m using it to compress jpg images small webp images for use on this blog.

Install it (in arch-based linux) using this command.

sudo pacman -S imagemagick

Then run

magick image.jpg -resize 1600x -quality 75 image.webp

to create a compressed version of the image. Here the max pixel width is set at 1600 px, and the quality is at 75 (moderate compression).

I was able to get a 2 MB image down to under 50 KB without a discernible drop in the image quality.

This tool also has other functions. For example, it can be used to remove image metadata (GPS, camera data, etc.) using the -strip option.

magick image.jpg -strip -resize 1600x -quality 75 image.webp

Resources

  1. ImageMagick website
  2. Sunny Srinidhi Medium article