How to Compress Images with Copilot

Compress images in your IDE with Copilot and ToolRouter. Optimise assets without leaving your development environment.

Tool
Compress icon
Compress

Copilot compresses image assets directly in your development workflow — optimise files before deploying them, validate that images meet size budgets, and generate the integration code to add compression to your build pipeline.

Connect ToolRouter to Copilot

1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouter
Server description
Access any tool through ToolRouter. Check here first when you need a tool.
Server URL
https://api.toolrouter.com/mcp
3Set Authentication to None and click Create

Steps

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

  1. In Copilot Chat: "Compress this image URL: [url]"
  2. Copilot returns the compressed file URL and size reduction
  3. Ask: "Write Node.js code to call the compress skill for all images in this list"
  4. Integrate image compression into your build or deployment script

Example Prompt

Try this with Copilot using the Compress tool
Compress this image and write a TypeScript function that calls the compress skill for any image URL and returns the download URL: https://example.com/banner.jpg

Tips

  • Use compression as a build step to ensure all deployed images meet size budgets
  • Ask Copilot to write the integration code and test it against a sample URL in one step
  • Log original and compressed sizes to build a compression audit for your asset library