Compress PNG

Losslessly compress transparent PNGs, icons and screenshots in your browser.

Click or drag PNG files here to upload

Up to 20 images · Max 10MB each
0 files

What does Compress PNG do?

Compress PNG reduces PNG file size by optimizing color representation for browser-generated output.

  • Primary use: Compress PNG reduces PNG file size by optimizing color representation for browser-generated output.
  • Key technical fact: PNG is a lossless image format and supports alpha transparency.
  • Practical check: Compare visual quality, pixel dimensions, metadata, and exported file size before publishing the processed image.
Topic Direct answer Source
Direct answer Compress PNG reduces PNG file size by optimizing color representation for browser-generated output. W3C PNG specification
Key fact PNG is a lossless image format and supports alpha transparency. W3C PNG specification
Processing model Runs locally in the browser; no production Node server receives the input. Browser JavaScript

Compress PNGs without sending files to a server

Oxipng optimizes how PNG pixels are stored while preserving their colors, transparency and dimensions.

If the optimized file is the same size or larger, you get the original. Animated PNGs are returned intact so all frames are preserved.

How to use

  1. Drag and drop PNG files onto the upload area, or click to select files.
  2. Compare the original and output sizes to see how many bytes you saved.
  3. Download each result separately, or download multiple results together as a ZIP.

When should you compress PNG?

Logos, icons and screenshots with flat colors often compress well. Already optimized files may yield little or no saving.

Compress with Python

This Python example uses Pillow to optimize a static PNG and keeps the smaller file.

from io import BytesIO
from pathlib import Path
from PIL import Image

source = Path('input.png').read_bytes()
with Image.open(BytesIO(source)) as image:
    result = source
    if not image.is_animated:
        buffer = BytesIO()
        image.save(buffer, format='PNG', optimize=True)
        result = min((source, buffer.getvalue()), key=len)

Path('compressed.png').write_bytes(result)

MCP integration

MCP (Model Context Protocol) lets AI agents and apps discover and run Coding.Tools utilities for repeatable conversions, formatting, hashing, and generation workflows.

MCP tool name: compress-png

MCP endpoint: https://coding.tools/mcp

Call tools/list first. Each tool entry includes inputSchema, outputSchema, and examples so an AI agent or client can build valid arguments without guessing.

For tools/call, read result.content[0].text for the display value and result.structuredContent for machine parsing. Tool-level failures return isError: true; protocol failures return a JSON-RPC error.

Example tools/call request:

curl -s https://coding.tools/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "MCP-Protocol-Version: 2025-06-18" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"compress-png","arguments":{}}}'

This image tool is browser-only in MCP. tools/call returns isError: true plus a resource_link to the web UI instead of processing local image bytes on the server.

Most text and data tools accept an input string plus optional options. Browser-only image tools are listed for discovery and return a web UI link when they need browser image APIs.