Your website’s hero image is 3.2MB. Your page takes 4 seconds to load. You don’t want to install ImageMagick or Photoshop. Here’s a one-liner using sips — a tool that comes pre-installed on every Mac.
sips --resampleWidth 1920 -s formatOptions 80 input.jpg --out output.jpg
This does three things:
I had a hero background image at 3805x2538px (3.2MB) and a duplicate copy at 5MB. After compression:
$ ls -lh hero-bg.jpg
-rw-r--r-- 3.2M hero-bg.jpg
$ sips --resampleWidth 1920 -s formatOptions 80 hero-bg.jpg --out hero-bg-compressed.jpg
$ ls -lh hero-bg-compressed.jpg
-rw-r--r-- 307K hero-bg-compressed.jpg
3.2MB to 307KB — a 90% reduction with no visible quality loss on screen.
1920px is the width of a standard Full HD display. For a background image, there’s no point shipping pixels that no one will see. Even on a 4K display, a well-compressed 1920px image stretched to full width looks fine for a background with a dark overlay.
Need to compress multiple images?
for img in assets/img/*.jpg; do
sips --resampleWidth 1920 -s formatOptions 80 "$img" --out "${img%.jpg}-compressed.jpg"
done
# Convert PNG to JPEG
sips -s format jpeg input.png --out output.jpg
# Get image dimensions
sips --getProperty pixelWidth --getProperty pixelHeight image.jpg
# Resize to exact dimensions (may crop)
sips -z 600 800 image.jpg
# Rotate 90 degrees
sips --rotate 90 image.jpg
sips is great for quick, scriptable compression. For more control (progressive JPEGs, WebP output, fine-tuned quality), consider:
cwebp — Google’s WebP converterjpegoptim — lossless JPEG optimization (brew install jpegoptim)squoosh.app — browser-based, no install neededBut for a quick “make this image smaller” task, sips is hard to beat since it’s already on your Mac.