Skip to content

Free toolsImages

Compress PNG

The quantiser TinyPNG made famous: 256 colours chosen well, transparency kept.

More free conversions, where you upload. The Fylane extension does the same work inside any upload form, on its own free share every day.About the extension

How to compress PNG

  1. Drop the PNG.
  2. Pick how many colours to keep.
  3. Press Compress and download.

What happens to your file

libvips quantises the picture to a palette of at most 256 colours, chosen for this picture, with dithering so gradients do not band, and writes an 8-bit PNG — the same trick TinyPNG sells. Transparency is kept. For screenshots, logos, icons and flat art the result is hard to tell apart; a photograph shows it, and is better as JPG or WebP anyway.

The report says the bytes before and after. A PNG that was already a palette PNG shrinks little.

Questions

Is it lossless?

No — colours are merged into a palette. That is why it is small. Compress image with a PNG target keeps every colour and shrinks less.

Why is my PNG so big to begin with?

A screenshot saved as 24-bit PNG stores millions of colours it does not use. The palette version stores 256.

Do this in code

curl -X POST https://api.fylane.dev/v1/jobs \
  -H "Authorization: Bearer $FYLANE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "<file id>",
    "operation": "image.convert",
    "options": {
      "format": "png",
      "palette": true,
      "quality": 75
    }
  }'

The same operation, image.convert — Re-encode to WebP, JPEG, PNG or AVIF at your quality. Upload first with the quickstart; every option is on the operations page. 500 free credits a month, then $5 per thousand.