Optimize images with PNGOUT (example 2)

By making your image files smaller, you can speed up your website and lower your bandwidth costs. PNGOUT and PNGCRUSH are the most commonly used PNG optimizers. Both tools are console applications without any GUI, and it is not so easy to use them in a Windows environment. Hstart can help to make them more user-friendly.

As I personally prefer PNGOUT, I will use it in my examples. PNGCRUSH works in the same way and you can use it too. Here is how to add an "Optimize with PNGOUT" option to the Explorer context (right-click) menu.

Optimize with PNGOUT

This menu item calls Hstart with the following command line:

hstart /NOCONSOLE /WAIT /TITLE=PNGOUT /MSG="Image compressed!"
       ""E:\BIN\pngout.exe" /q "D:\My Pictures\Screenshot.png""

After PNGOUT is executed (note the /WAIT switch), a simple message is displayed:

PNGOUT message

To enable this Shell command, create a new .REG file with the following content:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\pngfile\shell\PNGOUT]
[HKEY_CLASSES_ROOT\pngfile\shell\PNGOUT\command]
@="\"E:\\BIN\\hstart.exe\" /NOCONSOLE /WAIT /TITLE=PNGOUT /MSG=\"Image compressed!\" \"\"E:\\BIN\\pngout.exe\" /q \"%1\"\""

A few notes on the REG file:

  1. The REG files have a special interpretation of backslash characters: you have to use it before double quotes and backslashes if these characters appear in the data value (\\ => \ and \" => ").
  2. Don't forget to replace "E:\BIN\hstart.exe" and "E:\BIN\pngout.exe" with your own paths.

The sample REG file is also included in the Hstart package (see Examples\pngout).

Download - hstart.zip (23 KB)


Related Links

Optimizing PNG images:

Hstart examples:

* All screenshots on this page are made with WinSnap.