6 Apr
About two weeks ago I introduced 4 free command line tools that is able to compress image files without losing its quality. I’ve been using it daily to compress images before uploading it to this site and I find it a hassle to launch command prompt and manually typing the command line switches for every image file. Fortunately I managed to learn how to add a right click functionality to easily compress the file.
Let’s take pngout for an example. We want to be able to right click on a PNG file and select an option that automatically compress the file using pngout.
In Windows XP, go to Control Panel > Folder Options > click the File Types tab > look for PNG extensions and click the Advanced button. Click the New button, enter the following:
Action: pngout
Application used to perform this action: pngout.exe "%1" out.png

If you use the exact values above, make sure that pngout.exe is at C: drive or else you’ll get the error message “The specified program could not be found. Make sure the file name and path are correct.”. Alternatively, you could click the Browse button to locate pngout.exe. If you got it right, you should see pngout in the menu when you right click at a PNG image file. Selecting pngout from the menu will automatically launch pngout to compress the selected PNG file.

As for Vista, unfortunately it only allow the user to change the default program but cannot assign and associate different programs to different context menu entries. To do that, we’ll need to use third party software. I like to use ExtMan, a free and portable utility that is easy to use. By default the interface language is in German, just click the US flag to change it to English. ExtMan pretty similar to Windows XP File Types association. Just look for the PNG extension, click Edit Extension, click New Action button, and enter the values.

Here are a list of command line switches for all 4 command line PNG compressors.
The command below for OptiPNG will backup original PNG file by adding .bak extension.
C:\optipng.exe -k "%1"Command below will save the compressed PNG file as original filename + _compressed.png
C:\pngcrush.exe -e _compressed.png "%1"As for pngout, it will save the compressed PNG file as out.png.
C:\pngout.exe "%1" out.pngBe very careful because advpng doesn’t have the capability of backing up the original file. It can only overwrite the original PNG file.
C:\advpng.exe -z4 "%1"
Enjoy compressing PNG files without losing its quality by simply right clicking on the PNG image file!
Technorati Tags: compress, png, optimize, association, filetypes
: Copying this article to your website is strictly NOT allowed. However, if you like this article, you can use the HTML code below to directly link to this article.
Fix “This file does not have a program associated with it for performing this action” in Vista and 7 Easily edit your Photos online Fix FlashGet Default .torrent File Opener/Handler Association Giveaway: 200 FILEminimizer Pictures License To Be Given Away 4 Free Tools to Optimize and Compress PNG Images Without Losing Quality How to Open .PSD Extension Files Without Installing Adobe Photoshop Convert Archives Into Different Compression Formats (RAR to ZIP and etc)
Have computer technical problems? Get FREE help from Raymond.CC FORUM
7 Responses for "Edit Vista and XP File Types Association To Easily Compress PNG Image Files"
Excellent trick!!
Thnx Raymond
Can it be made as a registry file ?
good trick but can i write reg.
thankxxxxxx
I have a little problem,raymond.when i go to file types and then click on any 1 file type,the advanced button is still greyed out . i don’t have administrator rights ,maybe that is the problem.
Useful Nice Tweak!Please post a method to write a right-click function which runs c-cleaner or deletes temp & Temporary Internet Files or any automated Tasks?
To get a similar effect in Vista without 3rd party software, first creat a shortcut to pngout with the command line switch you prefer, then right-click on any .png file choose “Open with” then “Choose default program”. Click “Browse” and navigate to the shortcut you created. Select it & click OK. Then uncheck the box next to “Make this the default program…” & click OK. Now you’ll always be able to compress a .png file by right-clicking. choosing “Open with”, & selecting your shortcut from the drop-down menu.
It’s a nice trick Ray!!!
Thanks a lot.
Leave a reply