tifftopnm
Convert TIFF images to PNM format
TLDR
Convert a TIFF to a PNM file
Create a PGM file containing the alpha channel of the input image
Respect the fillorder tag in the input TIFF image
Print TIFF header information to stderr
SYNOPSIS
tifftopnm [options] [tiff_file]
PARAMETERS
-alphaout=alpha_file
Extracts the alpha (transparency) channel into a separate PGM file specified by alpha_file.
-headerdump
Dumps the raw TIFF header information to standard error and then exits, without converting the image.
-rowmajor
Processes image data in row-major order (top to bottom), overriding any internal TIFF strip/tile order.
-color
Interprets color values as linear, not sRGB, which is useful when dealing with ICC color profiles.
-colorf
Similar to -color but performs color calculations using floating-point precision for potentially higher accuracy.
-truecolor
Forces 24-bit color output (PPM) even for palette-based TIFF images, expanding the palette to true color.
-linear
Disables gamma correction, treating color values as linear intensity rather than gamma-corrected values.
-gamma=float
Applies a specific gamma correction factor, specified as a floating-point value.
-maxsample=value
Specifies the maximum sample value for output pixels, overriding the default derived from the TIFF file.
-raw
Outputs a raw PBM, PGM, or PPM image without the Netpbm header, for specific applications that handle raw pixel data directly.
-rowsperstrip=num
Specifies the maximum number of rows to process per strip, influencing memory usage during conversion.
-nofixg3
Disables certain fixes for issues sometimes found in Group 3 (fax) compressed TIFF files.
-multipage
Processes all pages of a multi-page TIFF file, producing multiple Netpbm outputs, typically concatenated.
-page=num
Selects a specific page (num) from a multi-page TIFF file to convert. Pages are 0-indexed.
-nopretty
Disables pretty-printing of the Netpbm output header, making it more compact (primarily for internal Netpbm testing).
-verbose
Prints informative messages about the conversion process and TIFF file details to standard error.
-extension
Allows specifying a different extension for the input TIFF file, useful for files with non-standard naming.
DESCRIPTION
tifftopnm is a utility from the Netpbm image manipulation suite that converts images in the Tagged Image File Format (TIFF) into one of the Netpbm formats: PBM (Portable Bitmap), PGM (Portable Graymap), or PPM (Portable Pixmap). The specific Netpbm format produced depends on the characteristics of the input TIFF image, such as its color depth and type (e.g., bilevel, grayscale, or color).
This command is essential for processing TIFF files within the Netpbm ecosystem, allowing users to leverage Netpbm's extensive array of tools for further image manipulation, such as scaling, cropping, or format conversion to other image types. It supports a wide range of TIFF compressions and features, making it a robust solution for integrating TIFF images into script-based or automated workflows. The output is typically directed to standard output, making it suitable for piping to other Netpbm commands.
CAVEATS
tifftopnm relies heavily on the libtiff library; limitations or bugs within libtiff may affect its behavior.
Complex or non-standard TIFF tags might not be fully supported, potentially leading to partial or incorrect conversions.
Output is to standard output (stdout), so redirection (`>`) is necessary to save the converted image to a file. For multi-page TIFFs with -multipage, this will concatenate all pages' output.
OUTPUT FORMAT DETERMINATION
tifftopnm automatically determines the appropriate Netpbm output format (PBM for bilevel, PGM for grayscale, or PPM for color) based on the input TIFF file's characteristics. This automatic detection simplifies usage, as users typically don't need to specify the output type explicitly.
PIPING OUTPUT
True to its Unix philosophy, tifftopnm writes its converted image data to standard output. This design allows it to be easily piped as input to other Netpbm commands or standard Unix utilities for further processing, such as pnmscale for resizing, cjpeg for JPEG conversion, or simply redirected to a file for saving the output.
HISTORY
tifftopnm is a component of the Netpbm project, a comprehensive toolkit for graphic file conversion and manipulation. Netpbm originated in the early 1990s as a successor to the PBMPLUS package, emphasizing a "toolkit" philosophy: providing small, simple, and powerful tools that can be chained together using Unix pipes. tifftopnm was developed to bridge the gap between the widely used TIFF format and the flexible Netpbm formats, enabling seamless interoperability and leveraging the extensive array of Netpbm utilities for image processing. Its continuous development reflects ongoing support for new TIFF features and compression schemes.