🔍
Hide
Most Effective Method to Reduce and Optimize PNG Images

Most Effective Method to Reduce and Optimize PNG Images

Introduction

Just recently, I was assigned to in charge of an iPhone game website. Due to the design, it needs heaps of png files so that I can use CSS to layer them together. It's quite a sophisticated website when it also come with a jQuery scrolling effect. I hope I can show it here, but it haven't released yet. :)

I like png, it supports by all the browsers (except IE6, but you have the hack anyway). Usually, I would use JPEG or GIF, but this time, most of the images has drop shadow and the background of the website is tiled with clouds. However, we're facing a problem, the file size of the PNG files are pretty massive. Though most of us has fast Internet, but it's good to optimized all the images to be as small as possible without losing quality.

One of my friend showed us this technique to reduce PNG file size and I was pretty amazed. All the time, the PNG optimizer is here with me. That's it, we're using Adobe Photoshop to do it. Of course, not the Save as web, just one more step, we can reduce PNG file size but still maintain its image quality.

So, Obviously, you need photoshop, not sure if Gimp have it.

Step 1: A PNG File

I choose an image randomly and this is it:

Optimize PNG - Choose a PNG file

Step 2: Posterize it

Go to the menu bar, Image -> Adjustment -> Posterize

Optimize PNG - Posterize option

Step 3: Posterize it

After you've clicked on Posterize, you should able to see a dialog . It has a slider for posterize level adjustment. Slowly adjust it to your desired quality. If you observed it carefully, you will able to see some colors are being discarded, and that's the way to reduce the file size.

Optimize PNG - Adjust posterize level

Step 4: Save as web

Okay, the final step - save your file. Go to File -> Save as web... Then, you've just optimized your PNG file! I believe your PNG file size is reduced.

Optimize PNG - Save as web

A small test

The following is some tests I have done to see how much file size it has reduced.

  • Optimize PNG - Save as web

    Original file - 147 KB

  • Optimize PNG - Save as web

    Web Optimized (Save as web without posterization) - 70 KB

  • Optimize PNG - Save as web

    Posterized and save as web - 53 KB

  • Optimize PNG - Save as web

    Posterized with slight losing of Image quality and save as web - 37 KB

Conclusion

There are a lot of softwares out there, but most of them couldn't do the job well. I still reckon we need human eyes to make sure we optimize the images properly without compromising too much of the image quality. This is a simple technique and I guess it's the most efficient and less time consuming. However, we do need Adobe photoshop or si image editor that has posterize or similar capabilities.

If you think, it's not worth it to run a big program just to do a small task, well, it works for me because I have photoshop running all the times. :) I hope it helps. Cheers.

If you have a better way to do it, don't forget to share it in the comment below :)


AdvertisementGet on time success in 1z0-520 dumps & HP2-Z16 exams by using our latest and high quality 312-50 and other superb 650-987 exam pass resources of E20-001.

Author: Kevin Liew

Kevin Liew is a web designer and developer and keen on contributing to the web development industry. He loves frontend development and absolutely amazed by jQuery. Feel free to say hi to me, or follow @quenesswebblog on twitter.

Share the love

63 Comments

Arian Pradana
Thu, 2nd August 2012
Awesome ! Big thanks !
i searching for this method has long :D Reply
Sanjay Kumar
Wed, 22nd August 2012
Thanks for the Solution :-) Reply
Andreas Ollmann
Mon, 3rd September 2012
If you build large websites with a lot of PNG with alpha channels, you might want to try this solution, which does the job automatically, using jQuery, canvas element and JS, saving up to 80% hazzle-free: http://headers-already-sent.com/artikel/shrinkimage-1 Reply
Aloysio Chagas
Fri, 28th September 2012
Really nice! Thank you! Reply
surya
Thu, 8th November 2012
Thanks for the Solution :-) Reply
Saman
Fri, 9th November 2012
Hi! Thanks for your tip! :) Reply
Richtown
Mon, 17th December 2012
thanks for sharing this!! Reply
Kenny
Fri, 4th January 2013
this is awesome - im making a monster png site - thought i was pushing the limit on the pngs with some scary file sizes. i've reduced the file size by near 80% so far and still experimenting. thanks a lot for this post! Reply
Max
Fri, 18th January 2013
Taimur Rehman
Fri, 12th April 2013
I was just looking for this trick, thanks man :) Reply
Rasmus
Mon, 15th April 2013
Brilliant! This worked wonders for me! Thank you for the excellent tip! Reply

Leave a Comment

Please keep in mind that comments are moderated and rel="nofollow" is in use. You can use [code][/code] if you want to write codes. Don't spam us :) Thanks!

Advertisement
Advertisement