{
    "mode": "man",
    "parameter": "tifftopnm",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/tifftopnm/1/json",
    "generated": "2026-05-30T05:16:25Z",
    "synopsis": "tifftopnm [-alphaout={alpha-filename,-}] [-headerdump] [-respectfillorder] [tiff-filename]\nYou may abbreviate any option to its shortest unique prefix.  You may use two hyphens instead\nof one in options.  You may separate an option and its value either  by  an  equals  sign  or\nwhite space.",
    "sections": {
        "NAME": {
            "content": "tifftopnm - convert a TIFF file into a portable anymap\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tifftopnm [-alphaout={alpha-filename,-}] [-headerdump] [-respectfillorder] [tiff-filename]\n\nYou may abbreviate any option to its shortest unique prefix.  You may use two hyphens instead\nof one in options.  You may separate an option and its value either  by  an  equals  sign  or\nwhite space.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  TIFF  file as input.  Produces a portable anymap as output.  The type of the output\nfile depends on the input file - if it's black  &  white,  generates  a  pbm  file;  if  it's\ngrayscale,  generates a pgm file; otherwise, a ppm file.  The program tells you which type it\nis writing.\n\nThis program cannot read every possible TIFF file -- there are myriad variations of the  TIFF\nformat.   However,  it  does  understand monochrome and gray scale, RGB, RGBA (red/green/blue\nwith alpha channel), CMYK (Cyan-Magenta-Yellow-Black ink color separation), and color palette\nTIFF  files.   An RGB file can have either single plane (interleaved) color or multiple plane\nformat.  The program reads 1-8 and 16 bit-per-sample input, the latter in either bigendian or\nlittlendian encoding.  Tiff directory information may also be either bigendian or littendian.\n\nOne  reason  this program isn't as general as TIFF programs often are is that it does not use\nthe TIFFRGBAImageGet() function of the TIFF library to read TIFF files.  Rather, it uses  the\nmore primitive TIFFReadScanLine() function and decodes it itself.\n\nThere  is  no  fundamental reason that this program could not read other kinds of TIFF files;\nthe existing limitations are mainly because no one has asked for more.\n\nThe PNM output has the same maxval as the Tiff input, except that if the Tiff input  is  col‐\normapped  (which  implies a maxval of 65535) the PNM output has a maxval of 255.  Though this\nmay result in lost information, such input images hardly ever actually have more color  reso‐\nlution  than  a  maxval of 255 provides and people often cannot deal with PNM files that have\nmaxval > 255.  By contrast, a non-colormapped Tiff image that doesn't need  a  maxval  >  255\ndoesn't  have a maxval > 255, so when we see a non-colormapped maxval > 255, we take it seri‐\nously and produce a matching output maxval.\n\nThe tiff-filename argument names the regular file that contains the Tiff image.  If you spec‐\nify  \"-\"  or  don't  specify this argument, tfftopnm uses Standard Input. In either case, the\nfile must be seekable.  That means no pipe, but any regular file is fine.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-alphaout=",
                    "content": "tifftopnm creates a PGM (portable graymap) file containing the alpha channel values in\nthe input image.  If the input image doesn't contain an alpha channel, the alpha-file‐\nname file contains all zero (transparent) alpha values.  If  you  don't  specify  -al‐‐\nphaout, tifftopnm does not generate an alpha file, and if the input image has an alpha\nchannel, tifftopnm simply discards it.\n\nIf you specify - as the filename, tifftopnm writes the alpha output to Standard Output\nand discards the image.\n\nSee pnmcomp(1) for one way to use the alpha output file.\n"
                },
                {
                    "name": "-respectfillorder",
                    "content": "By  default,  tifftopnm  ignores the \"fillorder\" tag in the TIFF input, which means it\nmay incorrectly interpret the image.  To make it follow the  spec,  use  this  option.\nFor  a  lengthy but engaging discussion of why tifftopnm works this way and how to use\nthe -respectfillorder option, see the note on fillorder below.\n\n"
                },
                {
                    "name": "-headerdump",
                    "content": "Dump TIFF file information to stderr.  This information may  be  useful  in  debugging\nTIFF file conversion problems.\n\nAll options can be abbreviated to their shortest unique prefix.\n\n"
                }
            ]
        },
        "NOTES": {
            "content": "",
            "subsections": [
                {
                    "name": "Fillorder",
                    "content": "There  is  a piece of information in the header of a TIFF image called \"fillorder.\"  The TIFF\nspecification quite clearly states that this value tells the order in which bits are arranged\nin a byte in the description of the image's pixels.  There are two options, assuming that the\nimage has a format where more than one pixel can be represented by a single byte: 1) the byte\nis  filled from most signficant bit to least signficant bit going left to right in the image;\nand 2) the opposite.\n\nHowever, there is confusion in the world as to the meaning of fillorder.  Evidence shows that\nsome  people  believe  it has to do with byte order when a single value is represented by two\nbytes.\n\nThese people cause TIFF images to be created that, while they  use  a  MSB-to-LSB  fillorder,\nhave  a  fillorder  tag that says they used LSB-to-MSB.  A program that properly interprets a\nTIFF image will not end up with the image that the author intended in this case.\n\nFor a long time, tifftopnm did not understand fillorder itself and assumed the fillorder  was\nMSB-to-LSB  regardless  of the fillorder tag in the TIFF header.  And as far as I know, there\nis no legitimate reason to use a fillorder other than MSB-to-LSB.  So users of tifftopnm were\nhappily using those TIFF images that had incorrect fillorder tags.\n\nSo  that  those  users can continue to be happy, tifftopnm today continues to ignore the fil‐\nlorder tag unless you tell it not to.  (It does, however, warn you  when  the  fillorder  tag\ndoes not say MSB-to-LSB that the tag is being ignored).\n\nIf for some reason you have a TIFF image that actually has LSB-to-MSB fillorder, and its fil‐\nlorder tag correctly indicates that, you must use the -respectfillorder option  on  tifftopnm\nto get proper results.\n\nExamples of incorrect TIFF images are at ftp://weather.noaa.gov.  They are apparently created\nby a program called faxtotiff.\n\nThis note was written on January 1, 2002.\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pnmtotiff(1), pnmtotiffcmyk(1), pnmcomp(1), pnm(5)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Derived by Jef Poskanzer from tif2ras.c, which is Copyright (c)  1990  by  Sun  Microsystems,\nInc.  Author: Patrick J. Naughton (naughton@wind.sun.com).\n\n\n\n02 April 2000                               tifftopnm(1)",
            "subsections": []
        }
    },
    "summary": "tifftopnm - convert a TIFF file into a portable anymap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "tifftopnm creates a PGM (portable graymap) file containing the alpha channel values in the input image. If the input image doesn't contain an alpha channel, the alpha-file‐ name file contains all zero (transparent) alpha values. If you don't specify -al‐‐ phaout, tifftopnm does not generate an alpha file, and if the input image has an alpha channel, tifftopnm simply discards it. If you specify - as the filename, tifftopnm writes the alpha output to Standard Output and discards the image. See pnmcomp(1) for one way to use the alpha output file."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "By default, tifftopnm ignores the \"fillorder\" tag in the TIFF input, which means it may incorrectly interpret the image. To make it follow the spec, use this option. For a lengthy but engaging discussion of why tifftopnm works this way and how to use the -respectfillorder option, see the note on fillorder below."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Dump TIFF file information to stderr. This information may be useful in debugging TIFF file conversion problems. All options can be abbreviated to their shortest unique prefix."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pnmtotiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtotiff/1/json"
        },
        {
            "name": "pnmtotiffcmyk",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtotiffcmyk/1/json"
        },
        {
            "name": "pnmcomp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmcomp/1/json"
        },
        {
            "name": "pnm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
        }
    ]
}