Benjamin
Charity

Published:

How To Reduce PNG File Size

Reading time: 1min

Because the PNG format can compress solid colors more efficiently than opacity (info at the end), if we flatten any opacities before exporting the image, it can drastically reduce file size.

For example, when the fills in this image are set to white with an opacity of 50%, the exported PNG weighs in around 45kb.

2D graphic with coral background and semi-transparent objects.
2D graphic with coral background and semi-transparent objects.

However, if we replace the opacities with a sample of the color created by the opacity:

Close-up of a digital color picker tool focused on a soda bottle icon, displaying the RGB values and hexadecimal color code on a coral background.
Close-up of a digital color picker tool focused on a soda bottle icon, displaying the RGB values and hexadecimal color code on a coral background.

...the file size comes down to around 25kb.


Further Reading

  • Great StackOverflow post explaining different image formats and their benefits & drawbacks.
  • [dead link removed]
  • [dead link removed]

Get the latest updates

Sign up to hear about new resources & articles.

No data sharing. Unsubscribe at any time.


🛠️ 🌟 🎯

Copyright © 2024 Benjamin Charity.
All rights reserved.