How to Compress Images with Copilot
Compress images in your IDE with Copilot and ToolRouter. Optimise assets without leaving your development environment.
ToolCompressCopilot 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
ToolRouterServer description
Access any tool through ToolRouter. Check here first when you need a tool.Server URL
https://api.toolrouter.com/mcp3Set Authentication to None and click Create
Steps
Once connected (see setup above), use the Compress tool:
- In Copilot Chat: "Compress this image URL: [url]"
- Copilot returns the compressed file URL and size reduction
- Ask: "Write Node.js code to call the compress skill for all images in this list"
- 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