Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

How to use OptiPNG and other PNG-related programs

or, Keeping PNG file sizes down for dummies

So, you figured out that the whole PNG file format totally wipes the floor with GIF's carcass. That's ok. But you open up Photoshop and make your mapthrough, and you get humongous GIF sizes! This is due to 2 reasons:

  1. Photoshop generally sucks at PNG compression.
  2. There is more than one way to compress a PNG file.

To ensure that your audience downloads the smallest file size available, you should follow my instructions exactly. While this method may not make a huge difference with small files, it can make a massive one with larger ones. For example, I took the biggest DEngel file I could find, his LoZ overworld map (471 kb). Conversion to PNG with XnView was 161 kb. Finally, with my OptiPNG chain it was reduced to 136 kb.

>Summary of Results
Size % decrease
Initial GIF 471 kb
Initial PNG 161 kb 65.8%
Final PNG 136 kb 15.5%

While it's not much, it can make quite a difference for dial up users. Anyway, here's how the steps will break down for you if you set up the chain correctly..

  1. Use batch file to execute a series of programs that optimize a PNG file for you.
  2. Wait several minutes, depending on processing power and file size.

So as you can see, it can be really helpful to set this up if you're a frequent mapper.

Cut the foreplay, tell me how to set this shit up

Okay.

Download these programs and extract the EXE files and any DLLs to your %PATH% environment variable. For normal people, this should be your C:\windows folder, but if you have other PATH locations you can place it there too.

Then, create a batch file in the same folder, name it whatever you want (like pngchain.bat) and put the following stuff in it:

@echo off
pngrewrite %1 %1
optipng -zc1-9 -zm1-9 -zs0-2 -f0-5 %1
advpng -z4 %1

Then create a shortcut to this batch file to your desktop by right-clicking it (and holding it), dragging to the desktop, and selecting "Create shortcut here..." Rename it to whatever you like. Then, whenever you want to uber-compress a PNG file that you want, simply drag and drop the icon of your file onto the shortcut and everything should be fine...I hope. If the whole drag and drop thing doesn't work out for you, you can always access the program from the command prompt (cmd or command from the Run... box).

Secret for people who read to the end of the page! (You still need to make the shortcut yourself, and it's a rar zip. Stupid Netfirms.)

If you are the creator of any of these programs and you object to having your work released in a package like this, please inform me and I will be happy to comply with your wishes.

[returneth]