How to Compress Images for Web with Claude

Compress images for web with Claude and ToolRouter. Faster page loads with optimized images.

Tool
Image Ops icon
Image Ops

Claude approaches image compression as an analytical conversation in your terminal. Share your images and performance goals, and Claude recommends compression levels based on image content type, asks about acceptable quality thresholds, and reports before-and-after metrics. Follow up with "can we push the compression further on the background images?" to optimize iteratively.

Connect ToolRouter to Claude

1Go to Settings → Connectors → Add custom connector
2Enter the details below and click Add
Name
ToolRouter
URL
https://api.toolrouter.com/mcp
3Done — works on Claude chat, desktop, and mobile

Steps

Once connected (see setup above), use the Image Ops tool:

  1. Ask Claude: "Compress this image for web use while maintaining quality using image-ops"
  2. Claude runs transform_image with optimal compression settings
  3. Review the compressed image and compare file sizes
  4. Ask Claude to compress additional images across your site

Example Prompt

Try this with Claude using the Image Ops tool
Compress all images on our landing page for web. Target 80% quality for photos and lossless for icons. Show me the savings.

Tips

  • Ask Claude to recommend different quality levels for different image types
  • Request a before/after file size comparison for each compressed image
  • Claude can compress and convert format in a single operation for maximum savings