
ppm2tiff Command in Linux
The ppm2tiff command in Linux converts PPM, PGM, and PBM images to TIFF images. PPM (Portable Pixmap) is a simple, uncompressed image format that stores color information in plain text or binary form, making files large and inefficient for practical use.
Converting PPM to TIFF (Tagged Image File Format) helps reduce file size with compression, improves compatibility with professional editing software, and supports metadata, making it more suitable for archiving, printing, or further processing.
Table of Contents
Here is a comprehensive guide to the options available with the ppm2tiff command −
- Installation of ppm2tiff Command in Linux
- Syntax of ppm2tiff Command
- ppm2tiff Command Options
- Examples of ppm2tiff Command in Linux
Installation of ppm2tiff Command in Linux
The ppm2tiff command is part of the libtiff-tools package in Linux. Ensure the package is installed before using the command. To install it on Ubuntu, Kali Linux, Raspberry Pi OS, Debian, and other Debian-based distributions, use the following command −
sudo apt install libtiff-tools
To install it on Arch Linux, use the command given below −
sudo pacman -S libtiff
To install libtiff-tools on Fedora, use the following command −
sudo dnf install libtiff-tools
To verify the installation of the ppm2tiff command, check its binary using the which command −
which ppm2tiff

Syntax of ppm2tiff Command
The syntax of the ppm2tiff command in Linux is as follows −
ppm2tiff [options] [input.ppm] [output.tiff]
In the above syntax −
- [options] − Specify compression type, resolution, etc.
- [input.ppm] − Input PPM file.
- [output.tiff] − Output TIFF file name.
ppm2tiff Command Options
The options of the ppm2tiff command are listed below −
Option | Description |
---|---|
-c | Set compression type: none (no compression), packbits (default), lzw (Lempel-Ziv & Welch), jpeg (baseline JPEG), zip (Deflate), g3 (CCITT Group 3), g4 (CCITT Group 4). |
-r | Set rows per strip; default is optimized for ~8 KB per strip. |
-R | Set image resolution in DPI (dots per inch). |
-h | Display usage help. |
Examples of ppm2tiff Command in Linux
In this section, the usage of the ppm2tiff command in Linux will be discussed with examples −
- Converting a PPM image to TIFF
- Converting a PPM image to TIFF with Compression
- Specifying Custom Rows Per Strip
- Specifying Custom Resolution
- Specifying Custom Resolution and Compression
- Displaying the Usage Help
Converting a PPM Image to TIFF
To convert a PPM image to TIFF, use the ppm2tiff command in the following way −
ppm2tiff image.ppm output.tiff

The above command generates an uncompressed TIFF file with the name of the output.tiff in the current working directory.
Converting a PPM image to TIFF with Compression
To convert a PPM file to TIFF with compression, use the -c option. To compress the TIFF with LZW (Lempel-Ziv & Welch) compression, use the ppm2tiff command in the following manner.
ppm2tiff -c lzw image.ppm output.tiff
Similarly, for JPEG compression, use −
ppm2tiff -c jpeg image.ppm output.tiff
For the ZIP compression use the command given below −
ppm2tiff -c zip image.ppm output.tiff
In the same way, other compression can be applied like g3/g4 or packbits.
Note that the compression options apply compression inside the TIFF container. They do not create standalone .jpg, or .zip files. The compression can be verified by comparing the compressed and uncompressed TIFF files as shown in the following image.

Specifying Custom Rows Per Strip
By default, the output is generated in approximately 8 rows per strip. To modify it, use the -r option −
ppm2tiff -r 16 image.ppm output.tiff
Specifying Custom Resolution
To set the resolution for the TIFF image, use the -R option with a value in dots per inch.
ppm2tiff -R 300 image.ppm output.tiff

Specifying Custom Resolution and Compression
To set the custom resolution and compression, use the -R and -c options in the following way −
ppm2tiff -R 300 -c zip image.ppm output.tiff
Displaying the Usage Help
To display the usage help of the ppm2tiff command, use the -h option −
ppm2tiff -h
Conclusion
The ppm2tiff command in Linux is a useful tool for converting PPM, PGM, and PBM images into the TIFF format. This conversion reduces file size, improves compatibility with editing software, and supports metadata.
The ppm2tiff command offers various options, such as setting compression types, adjusting resolution, and modifying strip rows for better optimization. Installation requires the libtiff-tools package, and the syntax follows a straightforward structure. With options like LZW, JPEG, and ZIP compression, ppm2tiff provides flexibility in handling image conversions efficiently.