How To Install python-libtiff on Debian 10

Learn how to install python-libtiff on Debian 10 with this tutorial. python-libtiff is wrapper to the libtiff library to Python using ctypes

Introduction

In this tutorial we learn how to install python-libtiff on Debian 10.

What is python-libtiff

python-libtiff is:

PyLibTiff is a package that provides:

  • a wrapper to the libtiff library to Python using ctypes.
  • a pure Python module for reading and writing TIFF and LSM files. The images are read as numpy.memmap objects so that it is possible to open images that otherwise would not fit to computers RAM.

There exists many Python packages such as PIL, FreeImagePy that support reading and writing TIFF files. The PyLibTiff project was started to have an efficient and direct way to read and write TIFF files using the libtiff library without the need to install any unnecessary packages or libraries. The pure Python module was created for reading “broken” TIFF files such as LSM files that in some places use different interpretation of TIFF tags than what specified in the TIFF specification document. The libtiff library would just fail reading such files. In addition, the pure Python module is more memory efficient as the arrays are returned as memory maps. Support for compressed files is not implemented yet.

Warning: pylibtiff currently supports reading and writing images that are stored using TIFF strips. Patches are welcome to support tiled TIFF images.

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

Install python-libtiff Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install python-libtiff

Install python-libtiff Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-libtiff

Install python-libtiff 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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install python-libtiff

How To Uninstall python-libtiff on Debian 10

To uninstall only the python-libtiff package we can use the following command:

sudo apt-get remove python-libtiff

Uninstall python-libtiff And Its Dependencies

To uninstall python-libtiff and its dependencies that are no longer needed by Debian 10, we can use the command below:

sudo apt-get -y autoremove python-libtiff

Remove python-libtiff Configurations and Data

To remove python-libtiff configuration and data from Debian 10 we can use the following command:

sudo apt-get -y purge python-libtiff

Remove python-libtiff configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-libtiff

Dependencies

python-libtiff have the following dependencies:

References

Summary

In this tutorial we learn how to install python-libtiff package on Debian 10 using different package management tools: apt, apt-get and aptitude.