{
    "mode": "man",
    "parameter": "pngtopnm",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pngtopnm/1/json",
    "generated": "2026-06-15T12:04:59Z",
    "synopsis": "pngtopnm [-verbose] [-alpha | -mix] [-background color]\n[-gamma value] [-text file] [-time] [pngfile]",
    "sections": {
        "NAME": {
            "content": "pngtopnm - convert a Portable Network Graphics file into portable anymap\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pngtopnm [-verbose] [-alpha | -mix] [-background color]\n[-gamma value] [-text file] [-time] [pngfile]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a Portable Network Graphics as input.  Produces a portable anymap as output.  The type\nof the output file depends on the input file - if it's black & white, a pbm file is  written,\nelse if it's grayscale a pgm file, else a ppm file.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-verbose",
                    "content": "Display  the  format  of the input file and the type of the output file. If the chunks\nare part of the png-file, the alpha, transparency and gamma-values will be indicated.\n"
                },
                {
                    "name": "-alpha",
                    "content": "file or pgm file, depending on whether different levels of transparency appear.\n"
                },
                {
                    "name": "-mix",
                    "content": "background chunk is available that color is taken, else black will do.\n"
                },
                {
                    "name": "-background color",
                    "content": "If no background color chunck is present in the png-file, or when another color is re‐\nquired this parameter can be used to set the background color of images. This is espe‐\ncially useful for alpha-channel images or those with transparency chunks. The  format,\nto  specify  the  color in, is either (in the case of orange) \"1.0,0.5,0.0\", where the\nvalues are floats between zero and one,  or  with  the  syntax  \"#RGB\",  \"#RRGGBB\"  or\n\"#RRRRGGGGBBBB\" where R, G and B are hexa-decimal numbers.\n"
                },
                {
                    "name": "-gamma value",
                    "content": "Converts  the  image to a new display-gamma value. When a gAMA chunk is present in the\npng-file, the image-gamma value will be used. When not, the image-gamma is  considered\nto  be  1.0. Based on the image-gamma and the display-gamma given with this option the\ncolors written to the pnm-file will be adjusted.\nBecause the gamma's of uncompensated monitors are around 2.6, which results in an  im‐\nage-gamma  of  0.45,  some  typical  situations are: when the image-gamma is 0.45 (use\n-verbose to check) and the picture is too light, your system  is  gamma-corrected,  so\nconvert  with  \"-gamma 1.0\".  When no gAMA chunk is present or the image-gamma is 1.0,\nuse 2.2 to make the picture lighter and 0.45 to make the picture darker.\n"
                },
                {
                    "name": "-text file",
                    "content": "Writes the tEXt and zTXt chunks to a file, in a format as described  in  the  pnmtopng\nman-page.  These chunks contain text comments or annotations.\n"
                },
                {
                    "name": "-time",
                    "content": "All flags can be abbreviated to their shortest unique prefix.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pnmtopng(1), ptot(1), pnmgamma(1), pnm(5)\n",
            "subsections": []
        },
        "NOTE": {
            "content": "Instead  of  pngtopnm|pnmtoxxx, a specific converter should be used, if available. E.g.  ptot\n(PNG to TIFF conversion), etc.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "There could be an option to read the comment text from pnm comments  instead  of  a  separate\nfile.\n\nThe program could be much faster, with a bit of code optimizing.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Copyright (C) 1995-1997 by Alexander Lehmann\nand Willem van Schaik.\n\n\n\n6 January 1997                                pngtopnm(1)",
            "subsections": []
        }
    },
    "summary": "pngtopnm - convert a Portable Network Graphics file into portable anymap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Display the format of the input file and the type of the output file. If the chunks are part of the png-file, the alpha, transparency and gamma-values will be indicated."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "file or pgm file, depending on whether different levels of transparency appear."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "background chunk is available that color is taken, else black will do."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If no background color chunck is present in the png-file, or when another color is re‐ quired this parameter can be used to set the background color of images. This is espe‐ cially useful for alpha-channel images or those with transparency chunks. The format, to specify the color in, is either (in the case of orange) \"1.0,0.5,0.0\", where the values are floats between zero and one, or with the syntax \"#RGB\", \"#RRGGBB\" or \"#RRRRGGGGBBBB\" where R, G and B are hexa-decimal numbers."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Converts the image to a new display-gamma value. When a gAMA chunk is present in the png-file, the image-gamma value will be used. When not, the image-gamma is considered to be 1.0. Based on the image-gamma and the display-gamma given with this option the colors written to the pnm-file will be adjusted. Because the gamma's of uncompensated monitors are around 2.6, which results in an im‐ age-gamma of 0.45, some typical situations are: when the image-gamma is 0.45 (use -verbose to check) and the picture is too light, your system is gamma-corrected, so convert with \"-gamma 1.0\". When no gAMA chunk is present or the image-gamma is 1.0, use 2.2 to make the picture lighter and 0.45 to make the picture darker."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Writes the tEXt and zTXt chunks to a file, in a format as described in the pnmtopng man-page. These chunks contain text comments or annotations."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "All flags can be abbreviated to their shortest unique prefix."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pnmtopng",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtopng/1/json"
        },
        {
            "name": "ptot",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ptot/1/json"
        },
        {
            "name": "pnmgamma",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmgamma/1/json"
        },
        {
            "name": "pnm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "This command has been superseded by `pngtopam`.",
        "examples": [
            {
                "description": "View documentation for the current command",
                "command": "tldr pngtopam"
            }
        ]
    }
}