Nov 5th, 2014, 11:10 AM
Utility: PngSizer - Resize PNG files without losing alpha transparency
A small GUI utility for resizing PNG image files, typically icon images for use in your programs, without losing alpha channel information.
Compiled EXE included in the attached archive.
Drag and drop or copy and paste a file from a Windows Explorer instance. Then choose new dimensions and click Save.
Can overwrite the original file, or create a new file in the same folder named with an inserted "-new" suffix.
Can optionally run the PNGOUT.EXE utility upon saving if present in the same folder as PngSizer.exe itself. You can obtain the PNGOUT optimizer utility from the author's official web page:
Sample file folder.png dropped onto PngSizer, Half button clicked
Save clicked, PNGOUT run completed
EXE requires Windows Vista or later (will run on Windows XP if the optional WIA 2.0 "WIAAUT" package has been installed).
Optionally can make use of PNGOUT.EXE (see above for download page).
Windows Vista or later (or Windows XP with WIAAUT).
VB 6.0 Professional or Enterprise.
Public domain "freeware." Feel free to make any use of the program or its source code that you choose.
The author accepts no liability for any negative consequences of the use of the compiled program or derivative works based on its source code.
This is "as-is" software.
The main use for this program is to convert a larger sized PNG "icon" image with alpha channel transparency and translucency to a smaller more compact size for use in your own programs. This should reduce the final size of your programs even if you resize such images to fit at run time.
Note that usually you won't want to resize down too far, unless you are targeting your exact final size. If your programs are doing run time resizing and alpha blending (e.g. for dealing with High DPI) you may want to avoid making your source images too small. A larger image preserves more definition from the original image, making your final images look a little better.
The quality of the result may vary if you pixel-slice... for example a 256x256 image resized to 128x128 is pretty clean while 256x256 to 105x105 might result in excessive aliasing effects. Avoid this when using PngSizer to create smaller source images for use by your programs.
The archive contains a sample PNG file (folder.png) for testing.
The bulk of the code in PngSizer is either user interface management logic or code used to run the external PNGOUT.EXE utility when available. The amount of code to do the image resizing itself is actually pretty small, delegating the heavy lifting to WIA 2.0 objects.
DFS - Drag-file source
The attached archive also includes the source to the DFS helper utility.
When you are testing within the VB6 IDE it should (as always) be running with elevated permission. Due to system process integrity rules drag and drop will not work with a non-elevated drag source (i.e. Windows Explorer). See Windows Vista Integrity Mechanism Technical Reference for more information.
If you compile the DFS program ahead of time, you can use it for testing drag and drop with PngSizer running within the elevated IDE. Running DFS displays a listbox containing all of the PNG files in the directory it is running from (App.Path in VB6 terms). You can click one of these to select it, then click and drag it to the running PngSizer window.
Last edited by dilettante; Nov 5th, 2014 at 10:42 PM.
Reason: Reposted attachment (fixed small bug)
Nov 5th, 2014, 12:24 PM
Re: Utility: PngSizer - Resize PNG files without losing alpha transparency
While the included "folder.png" is NOT mine, it is marked "Creative Commons (Attribution 3.0 Unported)" at:
The README states:
The particular file under discussion is a folder image, and if you really need a smaller size you might go to the source and grab one of those made available there instead of resizing it.
Last edited by dilettante; Nov 5th, 2014 at 12:35 PM.
Tags for this Thread
Click Here to Expand Forum to Full Width