libpng is an open source, portable, easy to install and completely free library software implemented in C and designed from the ground up to support the PNG (Portable Network Graphics) image format under any distribution of Linux.

The number one library to manipulate PNG images in Linux

The library is usually installed by default in all modern Linux kernel-based operating systems, if not all distributions, so you will be able to read and write PNG graphics files. Examples and tests are also provided to users in the source package to see if PNG support is fully enabled.

Keep in mind though, that libpng is a library, not a command-line program, which means that you won’t be able to interact with it, except for the ‘libpng-config’ command that offers various command-line options. A manpage is provided too, so you learn how to use it in your projects.

Getting started with libpng

To install the libpng library on your GNU/Linux operating system, if it isn’t already installed or if you want to install a different, newer/older version than the one installed, you must first download the latest version of the library from Softpedia, where it is distributed for free as a source tarball.

Save the TAR archive somewhere on your computer, extract its contents using any archive manager utility, open a terminal emulator application, and move to the location of the extracted archive files (e.g. cd /home/softpedia/libpng-1.6.16).

Then, arrived at the location of the extracted archive files, run the ‘.configure’ command to configure the program and optimize it for your hardware architecture/operating system using available options (run the ‘./configure –help’ command to see these options).

After configuring libpng, run the ‘make’ command to compile it. Finally, after a successful compilation, run the ‘sudo make install’ as a privileged user or the ‘make install’ command as root to install the library system wide.