What pngquant is and why you might need it
Pngquant is a command-line tool that compresses PNG images by reducing the number of colors they contain, making files smaller without losing much visible quality. If you work with web design, image optimization, or batch processing of PNG files, pngquant can save you time and storage space. On Windows, it does not have a graphical interface — you run it from the command prompt or PowerShell — but the installation itself takes just a few minutes.
The tool works by converting full-color PNGs (which can contain millions of colors) into 8-bit indexed PNGs (which use a palette of up to 256 colors). For photographs and complex images, this can cut file size in half or more. For graphics, icons, and screenshots, the visual difference is often invisible to the human eye.
Key Takeaways
- Download the Windows binary directly from the official pngquant GitHub releases page, not from third-party sites.
- Extract the downloaded ZIP file to a folder on your computer, then add that folder to your system PATH so you can run pngquant from any command prompt.
- Test the installation by opening PowerShell or Command Prompt and typing pngquant --version to confirm it works.
- Once installed, you compress a PNG by typing pngquant 256 filename.png in the command prompt, which creates a new file with -fs8.png added to the name.
Download the correct Windows version
Go to the official pngquant releases page on GitHub at github.com/kornelski/pngquant/releases. Scroll down to find the latest release and look for a file named something like pngquant-2.x.x-windows.zip (the version number will vary). Click the link to download it. Do not download from other websites — the official GitHub page is the safest source.
The file you download is a ZIP archive containing the pngquant executable and a few supporting files. Save it somewhere you can find it, such as your Downloads folder. The download is usually under 1 megabyte, so it should finish in seconds on any internet connection.
Extract the files to a permanent location
Right-click the ZIP file you downloaded and select Extract All. Windows will ask you where to put the extracted files. Choose a location where you keep programs and tools — a common choice is C:\Program Files\pngquant or C:\Tools\pngquant. Avoid putting it in a temporary folder or on a removable drive, because you want the tool to stay in the same place.
After extraction, open the folder where you extracted the files. You should see a file named pngquant.exe (or just pngquant if Windows is hiding file extensions). This is the program you will run. Note the full path to this folder — you will need it in the next step.
Add pngquant to your system PATH
Adding pngquant to your PATH means Windows will find it no matter which folder you are in when you open the command prompt. Right-click This PC or My Computer on your desktop or in File Explorer, then select Properties. On the left side, click Advanced system settings. In the window that opens, click the Environment Variables button near the bottom.
In the Environment Variables window, under User variables, look for a variable named Path. If it exists, click it and then click Edit. If it does not exist, click New and type Path as the variable name. In the edit window, click New and paste the full path to your pngquant folder (for example, C:\Program Files\pngquant). Click OK three times to close all the windows.
You must restart any open command prompts or PowerShell windows for the PATH change to take effect. If you have a command prompt open, close it and open a new one.
Test that pngquant is working
Open PowerShell or Command Prompt. (Press the Windows key, type powershell or cmd, and press Enter.) Type the following command and press Enter:
pngquant --version
If pngquant is installed correctly, you will see output like 2.17.0 or another version number. If you see an error message like "pngquant is not recognized as an internal or external command", the PATH was not set correctly. Go back to the Environment Variables step and double-check that you entered the folder path exactly as it appears on your computer.
Compress your first PNG file
To compress a PNG, open Command Prompt or PowerShell in the folder where your PNG file is located. (You can do this by holding Shift, right-clicking in the folder, and selecting Open PowerShell window here.) Then type a command like this:
pngquant 256 myimage.png
Replace myimage.png with the actual name of your file. The number 256 tells pngquant to use up to 256 colors in the compressed version. Pngquant will create a new file named something like myimage-fs8.png in the same folder. The original file stays unchanged. If you want to replace the original, you can add the --force flag: pngquant --force 256 myimage.png.
For more control over compression, you can use other options. For example, pngquant 128 myimage.png uses only 128 colors (smaller file, lower quality), and pngquant --quality 70-90 myimage.png lets pngquant choose the color count to hit a quality target. Type pngquant --help to see all available options.
Troubleshooting common issues
If you get a "file not found" error when trying to compress a PNG, make sure you are in the correct folder and that the filename is spelled exactly right, including the .png extension. If pngquant runs but the output file looks worse than you expected, try using fewer colors (like pngquant 128 instead of 256) or the quality flag to find a balance that works for your images.
If pngquant crashes or produces corrupted output, the PNG file itself may be damaged. Try the tool on a different PNG file to confirm pngquant is working. If the problem happens with all files, reinstall pngquant by deleting the folder and repeating the download and extraction steps.
Frequently Asked Questions
Do I need administrator rights to install pngquant?
No. You can extract pngquant to any folder your user account can write to, such as your Documents folder or a Tools folder in your user directory. You only need administrator rights if you want to put it in C:\Program Files, and even then, Windows will ask for permission when you try to create the folder.
Can I use pngquant on Mac or Linux?
Yes. Pngquant runs on Mac, Linux, and Windows. On Mac, you can install it using Homebrew by typing brew install pngquant. On Linux, most package managers include it — try apt install pngquant on Debian-based systems or yum install pngquant on Red Hat-based systems.
What if I want to compress many PNG files at once?
You can use a batch command. In PowerShell, navigate to the folder containing your PNGs and type: Get-ChildItem *.png | ForEach-Object { pngquant 256 $_.Name }. This runs pngquant on every PNG file in that folder. Each compressed file will be saved with the -fs8.png suffix.
Will pngquant work on PNG files that are already compressed?
Yes, but the file size reduction will be smaller. Pngquant is most effective on PNGs that use many colors or have not been optimized before. If a PNG is already highly compressed, pngquant may not reduce the size much further.
Is pngquant free?
Yes. Pngquant is open-source software released under the GPL license. You can download it, use it, and modify it for free.