pngquant command not found

In this troubleshooting guide we learn how to fix pngquant command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

pngquant: command not found

or when using sudo you get the following error message

sudo: pngquant: command not found

Solutions to pngquant: command not found

How To Fix pngquant: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu pngquant is provided by pngquant package.

pngquant is:

pngquant is a command-line conversion utility to quantize and dither truecolor PNG images, especially those with a full alpha channel, down to 8-bit (or smaller) RGBA-palette PNGs. Such images are usually two to four times smaller than the full 32-bit versions, and partial transparency is preserved quite nicely. This makes pngquant especially useful both for Web sites and for PlayStation 2 development, where one of the texture formats is RGBA-palette-based (though not PNG-compressed). This is the same technique used for many of the images on the Miscellaneous Transparent PNGs page (http://www.libpng.org/pub/png/pngs-img.html), and the results are often indistinguishable from the original, truecolor PNG images.

Optimizers (like pngcrush and optipng) optimize the compression, usually losslessly, while pngquant quantizes colors down to 256 (or fewer) distinct RGBA combinations, which is lossy.

To fix this problem, we can install more using the command below.

sudo apt-get -y install pngquant

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install pngquant.

sudo apt -y install pngquant

Or if you have aptitude installed you can use the following command.

sudo aptitude install pngquant

Summary

In this tutorial we learn how to fix pngquant command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.