How To Install pngnq on Ubuntu 22.04

In this tutorial we learn how to install pngnq on Ubuntu 22.04. pngnq is tool for optimizing PNG (Portable Network Graphics) images

Introduction

In this tutorial we learn how to install pngnq on Ubuntu 22.04.

What is pngnq

pngnq is:

Pngnq is a tool for quantizing 32-bit RGBA PNG images to 8-bit RGBA pallete PNG. It’s is an adaptation by Stuart Coyle of Greg Roelf’s pnqquant. While pngquant uses a median cut algorithm, Pngnq uses Anthony Dekker’s neuquant algorithm (http://members.ozemail.com.au/~dekker/NEUQUANT.HTML), generally resulting in better looking results than pngquant.

Optimizers (like pngcrush and optipng) optimize the compression, usually losslessly. pngnq quantizes colors down to 256 (or fewer) distinct RGBA combinations, which is quite lossy. Optimized PNGs are usually two to four times smaller than the 32-bit versions.

There are three methods to install pngnq on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install pngnq Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install pngnq using apt-get by running the following command:

sudo apt-get -y install pngnq

Install pngnq Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install pngnq using apt by running the following command:

sudo apt -y install pngnq

Install pngnq Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install pngnq using aptitude by running the following command:

sudo aptitude -y install pngnq

How To Uninstall pngnq on Ubuntu 22.04

To uninstall only the pngnq package we can use the following command:

sudo apt-get remove pngnq

Uninstall pngnq And Its Dependencies

To uninstall pngnq and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove pngnq

Remove pngnq Configurations and Data

To remove pngnq configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge pngnq

Remove pngnq configuration, data, and all of its dependencies

We can use the following command to remove pngnq configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge pngnq

References

Summary

In this tutorial we learn how to install pngnq package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.