# PNG Optimization

Sirv optimizes PNG images by default, which makes their files much smaller. Compare the file sizes in the demo below.

Try it

Not optimized

Loading…

With options

Loading…

PNG optimize

OnOff

https://demo.sirv.com/sale-icon.png**?format=png&png.optimize=true**

[](https://demo.sirv.com/sale-icon.png?format=png&png.optimize=true)

Using an AI coding agent?

Install the [`image-optimization`](https://www.skills.sh/sirv/image-optimization-skill/image-optimization) skill, and your agent can set up Sirv images in your project. Ask in plain words, such as “Serve our product images from Sirv and make them load faster.” [See all 8 skills](/help/rest-api/sirv-skills-for-ai-agents/)

Sirv automatically serves your images in the ‘optimal’ format, which will automatically serve your images as either WebP or optimized PNG, whichever is more efficient.

The amount of PNG optimization applied by Sirv depends on the image size. The smaller the image, the greater the optimization (in steps from 300x300, 500x500, 700x700, 900x900, 1200x1200).

PNG images larger than 1500x1500 pixels are not optimized by default. To force an image to be always served as PNG to all browsers, set format to png:

`https://demo.sirv.com/look.jpg?format=png`

format lets you control PNG optimization with true/false. By default, PNG optimization is enabled for the [optimal format](/help/dynamic-imaging/format-quality/format/) and disabled if format is set to a different value.

If you have changed the format value and wish to enable PNG optimization, set it to true, like so:

`https://demo.sirv.com/look.jpg?format=png&png.optimize=true`

!\[Example image optimized PNG\]([https://demo.sirv.com/look.jpg?w=400&format=png&png.optimize=true&text.position=northwest&text=size=34](https://demo.sirv.com/look.jpg?w=400&format=png&png.optimize=true&text.position=northwest&text=size=34) KB (optimize=true)

&text.font.family=Roboto Condensed&text.font.size=14px&text.color=white)

PNG optimization dramatically speeds up delivery of your images. Sirv performs up to 20 passes to find the best possible optimizations.

This optimization process is very fast, usually completing within 0.15 second. The optimized image is then cached and ready to serve to all for future viewers.

Compare the unoptimized image to the left (**80 KB**) against the optimized image to the right (only **20 KB**):

![Unoptimized PNG](https://sirv.sirv.com/website/demos/bottle.png?png.optimize=0&h=400&text=png.optimize%3D0&text.size=58%&text.color=blue)

Not optimized

![Optimized PNG](https://sirv.sirv.com/website/demos/bottle.png?png.optimize=1&h=400&text=png.optimize%3D1&text.size=58%&text.color=blue)

Optimized

Both images look the same, but the optimized one is four times smaller.
