{
    "content": [
        {
            "type": "text",
            "text": "# pnmtopng (man)\n\n## NAME\n\npnmtopng - convert a PNM image to PNG\n\n## SYNOPSIS\n\npnmtopng  [-verbose]  [-downscale] [-interlace] [-alpha=file] [-transparent=[=]color] [-back‐\nground=color]  [-palette=palettefile]  [-gamma=value]   [-hist]   [-text=file]   [-ztxt=file]\n[-rgb='wx wy\nrx ry gx gy bx by'] [-size='x y unit'] [-srgbintent=intent] [-modtime='[yy]yy-mm-dd\nhh:mm:ss']  [-nofilter]  [-sub]  [-up] [-avg] [-paeth] [-compression=n] [-compmemlevel=n]\n[-compstrategy={huffmanonly|filtered}]    [-compmethod=deflated]     [-compwindowbits=n]\n[-compbuffersize=n] [-force] [-libversion] [pnmfile]\n\n## DESCRIPTION\n\nThis program is part of Netpbm(1).\n\n## TLDR\n\n> Convert a PNM image file to PNG image format.\n\n- Read a PNM image as input and produce a PNG image as output:\n  `pnmtopng {{path/to/file.pnm}} > {{path/to/file.png}}`\n- Display version:\n  `pnmtopng {{-vers|-version}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **OPTION USAGE**\n- **DESCRIPTION**\n- **OPTIONS** (31 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n- **DOCUMENT SOURCE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pnmtopng",
        "section": "",
        "mode": "man",
        "summary": "pnmtopng - convert a PNM image to PNG",
        "synopsis": "pnmtopng  [-verbose]  [-downscale] [-interlace] [-alpha=file] [-transparent=[=]color] [-back‐\nground=color]  [-palette=palettefile]  [-gamma=value]   [-hist]   [-text=file]   [-ztxt=file]\n[-rgb='wx wy\nrx ry gx gy bx by'] [-size='x y unit'] [-srgbintent=intent] [-modtime='[yy]yy-mm-dd\nhh:mm:ss']  [-nofilter]  [-sub]  [-up] [-avg] [-paeth] [-compression=n] [-compmemlevel=n]\n[-compstrategy={huffmanonly|filtered}]    [-compmethod=deflated]     [-compwindowbits=n]\n[-compbuffersize=n] [-force] [-libversion] [pnmfile]",
        "tldr_summary": "Convert a PNM image file to PNG image format.",
        "tldr_examples": [
            {
                "description": "Read a PNM image as input and produce a PNG image as output",
                "command": "pnmtopng {{path/to/file.pnm}} > {{path/to/file.png}}"
            },
            {
                "description": "Display version",
                "command": "pnmtopng {{-vers|-version}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This causes pnmtopng to display information about the format of the output file."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This enables pnmtopng to scale maxvalues of more then 65535 to 16 bits. Since this means loss of image data, pnmtopng does not do it by default."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This causes the PNG file to be interlaced, in Adam7 format. The interlaced format is one in which the raster data starts with a low-resolution representation of the entire image, then continues with additional information for the entire image, then even more information, etc. In Adam7 in particular, there are seven such passes of the whole image. This is useful when you are receiving the image over a slow communication line as someone is waiting to see it. The simplest thing to do in that case is wait for the entire image to arrive and then display it instantly, but then the user is wasting time staring at a blank space until the whole image arrives. With the standard non- interlaced format, the data arrives row-by-row starting at the top, so the displayer could display each row of the image as it arrives and gradually paint down to the bot‐ tom. But with an interlaced image, the displayer can start by showing a low-resolu‐ tion version of the image, then gradually improve the display as more data arrives."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This specifies the transparency (alpha) channel of the image. You supply the trans‐ parency channel as a standard PGM transparency mask (see the PGM(1) specification. pnmtopng does not necessarily represents the transparency information as a trans‐ parency channel in the PNG format. If it can represent the transparency information through a palette, it will do so in order to make a smaller PNG file. pnmtopng even sorts the palette so it can omit the opaque colors from the transparency part of the palette and save space for the palette."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "pnmtopng marks the specified color as transparent in the PNG image. Specify the color (color) as described for the \u001b]8;;libnetpbmimage.html#colorname\u001b\\argument of the pnmparsecolor() li‐ brary routine\u001b]8;;\u001b\\ . E.g. red or rgb:ff/00/0d. If the color you specify is not present in the image, pnmtopng selects instead the color in the image that is closest to the one you specify. Closeness is measured as a Cartesian distance between colors in RGB space. If multiple colors are equidistant, pnmtopng chooses one of them arbitrarily. However, if you prefix your color specification with \"=\", e.g. -transparent =red only the exact color you specify will be transparent. If that color does not appear in the image, there will be no transparency. pnmtopng issues an information message when this is the case."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Causes pnmtopng to create a background color chunk in the PNG output which can be used for subsequent transparency channel or transparent color conversions. Specify color the same as for -transparent."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option specifies a palette to use in the PNG. It forces pnmtopng to create the paletted (colormapped) variety of PNG -- if that isn't possible, pnmtopng fails. If the palette you specify doesn't contain exactly the colors in the image, pnmtopng fails. Since pnmtopng will automatically generate a paletted PNG, with a correct palette, when appropriate, the only reason you would specify the -palette option is if you care in what order the colors appear in the palette. The PNG palette has colors in the same order as the palette you specify. You specify the palette by naming a PPM file that has one pixel for each color in the palette. Alternatively, consider the case that have a palette and you want to make sure your PNG contains only colors from the palette, approximating if necessary. You don't care what indexes the PNG uses internally for the colors (i.e. the order of the PNG palette). In this case, you don't need -palette. Pass the Netpbm input image and your palette PPM through pnmremap. Though you might think it would, using -palette in this case wouldn't even save pnmtopng any work."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Causes pnmtopng to create a gAMA chunk. This information helps describe how the color values in the PNG must be interpreted. Without the gAMA chunk, whatever interprets the PNG must get this information separately (or just assume something standard). If your input is a true PPM or PGM image, you should specify -gamma=.52. But sometimes people generate images which are ostensibly PPM except the image uses a different gamma transfer function than the one specified for PPM. A common case of this is when the image is created by simple hardware that doesn't have digital computational abil‐ ity. Also, some simple programs that generate images from scratch do it with a gamma transfer in which the gamma value is 1.0."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "the colors in the image."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option lets you include arbitrary text strings in the PNG output, as tEXt chunks. filename is the name of a file that contains your text strings. The output contains a distinct tEXt chunk for each entry in the file. Here is an example of a text string file: Title PNG file Author John Doe Description how to include a text chunk PNG file \"Creation Date\" 2015-may-11 Software pamtopng The file is divided into entries, each entry comprising consecutive lines of text. The first line of an entry starts in the first column (i.e. the first column is not white space) and every other line has white space in the first column. The first en‐ try starts in the first line, so it is not valid for the first line of the file to have white space in its first column. The first word in an entry is the key of the text string (e.g. 'Title'). It begins in column one of the line and continues up to, but not including, the first delimiter character or the end of the line, whichever is first. You can enclose the key in dou‐ ble quotes in which case the key can consists of multiple words. The quotes are not part of the key. The text string per se begins after the key and any delimiter char‐ acters after it, plus the text in subsequent continuation lines. There is no limit on the length of a file line or entry or key or text string. There is no limit on the number of entries."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The same as -text, except the text string is compressed in the PNG output. pnmtopng uses zTXt chunks instead of a tEXt chunks, unless the key for the text string starts with 'A' or 'T'. This odd exception exists for backward compatibility; we don't know why the program was originally designed this way, except that the distinction was meant to roughly identify the keys 'Author' and 'Title'."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option specifies how red, green, and blue component values of a pixel specify a particular color, by telling the chromaticities of those 3 primary illuminants and of white (i.e. full strength of all three). The chromalist value is a blank-separated list of 8 floating point decimal numbers: the CIE-1931 X and Y chromaticities (in that order) of each of white, red, green, and blue, in that order. This information goes into the PNG's cHRM chunk. In a shell command, make sure you use quotation marks so that the blanks in chromalist don't make the shell see multiple command arguments. This option was new in Netpbm 10.30 (October 2005). Before that, the option -chroma does the same thing, but with slightly different syntax."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option determines the aspect ratio of the individual pixels of your image as well as the physical resolution of it. unit is either 0 or 1. When it is 1, the option specifies the physical resolution of the image in pixels per meter. For example, -size=\"10000 15000 1\" means that when someone displays the image, he should make it so that 10,000 pixels horizontally oc‐ cupy 1 meter and 15,000 pixels vertically occupy one meter. And even if he doesn't take this advice on the overall size of the displayed image, he should at least make it so that each pixel displays as 1.5 times as high as wide. When unit is 0, that means there is no advice on the absolute physical resolution; just on the ratio of horizontal to vertical physical resolution. This information goes into the PNG's pHYS chunk. When you don't specify -size, pnmtopng creates the image with no pHYS chunk, which means square pixels of no absolute resolution. This option was new in Netpbm 10.30 (October 2005). Before that, the option -phys does the same thing, but with slightly different syntax."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This asserts that the input is a pseudo-Netpbm image that uses an sRGB color space (unlike true Netpbm) and indicates how you intend for the colors to be rendered. It causes pnmtopng to include an sRGB chunk in the PNG image that specifies that intent, so see the PNG documentation for more information on what this really means. intent is one of: • perceptual • relativecolorimetric • saturation • absolutecolorimetric This option was new in Netpbm 10.71 (June 2015). Before that, pnmtopng never gener‐ ates an sRGB chunk."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option allows you to specify the modification time value to be placed in the PNG output. You can specify the year parameter either as a two digit or four digit value. This option was new in Netpbm 10.30 (October 2005). Before that, the option -time does the same thing, but with slightly different syntax."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option is obsolete. Before Netpbm 10.22 (April 2004), this was the only way to specify a row filter. It specifies a single type of row filter, by number, that pnm‐ topng must use on each row. Use -nofilter, -sub, -up, -avg, and -paeth in current Netpbm."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "chooses whichever of the permitted filters it finds to be optimal. If you specify none of these options, it is the same as specifying all of them -- pnmtopng uses any row filter type it finds optimal. These options were new with Netpbm 10.22 (April 2004). Before that, you could use the -filter option to specify one permitted row filter type. The default, when you spec‐ ify no filter options, was the same."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option sets set the compression level of the zlib compression. Select a level from 0 for no compression (maximum speed) to 9 for maximum compression (minimum speed). The default is the default of the zlib library."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option sets the memory usage level of the zlib compression. Select a level from 1 for minimum memory usage (and minimum speed) to 9 for maximum memory usage (and speed). The default is the default of the zlib library. This option was new in Netpbm 10.30 (October 2005)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This options sets the compression strategy of the zlib compression. See Zlib documen‐ tation for information on what these strategies are. The default is the default of the zlib library. This option was new in Netpbm 10.30 (October 2005)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option does nothing. It is here for mathematical completeness and for possible forward compatibility. It theoretically selects the compression method of the zlib compression, but the Z library knows only one method today, so there's nothing to choose. The default is the default of the zlib library. This option was new in Netpbm 10.30 (October 2005)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option tells how big a window the zlib compression algorithm uses. The value is the base 2 logarithm of the window size in bytes, so 8 means 256 bytes. The value must be from 8 to 15 (i.e. 256 bytes to 32K). See Zlib documentation for details on what this window size is. The default is the default of the zlib library. This option was new in Netpbm 10.30 (October 2005)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option determines in what size pieces pnmtopng does the zlib compression. One compressed piece goes in each IDAT chunk in the PNG. So the bigger this value, the fewer IDAT chunks your PNG will have. Theoretically, this makes the PNG smaller be‐ cause 1) you have less per-IDAT-chunk overhead, and 2) the compression algorithm has more data to work with. But in reality, the difference will probably not be notice‐ able above about 8K, which is the default. The value n is the size of the compressed piece (i.e. the compression buffer) in bytes. This option was new in Netpbm 10.30 (October 2005)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "as similar to the Netpbm input as possible. For example, the PNG output will not be paletted and the transparency channel will be represented as a full transparency chan‐ nel even if the information could be represented more succinctly with a transparency chunk."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option causes pnmtopng to display version information about itself and the li‐ braries it uses, in addition to all its normal function. Do not confuse this with the Netpbm common option -version, which causes the program to display version information about the Netpbm library and do nothing else. You can't really use this option in a program that invokes pnmtopng and needs to know which version it is. Its function has changed too much over the history of pnmtopng. The option is good only for human eyes."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pngtopam",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pngtopam/1/json"
            },
            {
                "name": "pamtopng",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamtopng/1/json"
            },
            {
                "name": "pnmremap",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmremap/1/json"
            },
            {
                "name": "pnmgamma",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmgamma/1/json"
            },
            {
                "name": "pnm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "OPTION USAGE",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Note: Option Syntax of Older Versions",
                        "lines": 22
                    },
                    {
                        "name": "Current Options",
                        "lines": 5
                    },
                    {
                        "name": "-verbose",
                        "lines": 5
                    },
                    {
                        "name": "-downscale",
                        "lines": 6
                    },
                    {
                        "name": "-interlace",
                        "lines": 16
                    },
                    {
                        "name": "-alpha=_",
                        "lines": 11
                    },
                    {
                        "name": "-transparent=_",
                        "lines": 18
                    },
                    {
                        "name": "-background=_",
                        "lines": 7
                    },
                    {
                        "name": "-palette=_",
                        "lines": 19
                    },
                    {
                        "name": "-gamma=_",
                        "lines": 13
                    },
                    {
                        "name": "-hist",
                        "lines": 5
                    },
                    {
                        "name": "-text=_",
                        "lines": 33
                    },
                    {
                        "name": "-ztxt=_",
                        "lines": 9
                    },
                    {
                        "name": "-rgb=_",
                        "lines": 17
                    },
                    {
                        "name": "-size=\"_",
                        "lines": 22
                    },
                    {
                        "name": "-srgbintent=_",
                        "lines": 22
                    },
                    {
                        "name": "-modtime=\"",
                        "lines": 7
                    },
                    {
                        "name": "-filter=_",
                        "lines": 7
                    },
                    {
                        "name": "-nofilter",
                        "lines": 1
                    },
                    {
                        "name": "-sub",
                        "lines": 1
                    },
                    {
                        "name": "-up",
                        "lines": 1
                    },
                    {
                        "name": "-avg",
                        "lines": 1
                    },
                    {
                        "name": "-paeth",
                        "lines": 9
                    },
                    {
                        "name": "-compression=_",
                        "lines": 7
                    },
                    {
                        "name": "-comp_mem_level=_",
                        "lines": 9
                    },
                    {
                        "name": "-comp_strategy=",
                        "lines": 8
                    },
                    {
                        "name": "-comp_method=deflated",
                        "lines": 10
                    },
                    {
                        "name": "-comp_window_bits=_",
                        "lines": 11
                    },
                    {
                        "name": "-comp_buffer_size",
                        "lines": 14
                    },
                    {
                        "name": "-force",
                        "lines": 8
                    },
                    {
                        "name": "-libversion",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DOCUMENT SOURCE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pnmtopng - convert a PNM image to PNG\n\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "pnmtopng  [-verbose]  [-downscale] [-interlace] [-alpha=file] [-transparent=[=]color] [-back‐\nground=color]  [-palette=palettefile]  [-gamma=value]   [-hist]   [-text=file]   [-ztxt=file]\n[-rgb='wx wy\nrx ry gx gy bx by'] [-size='x y unit'] [-srgbintent=intent] [-modtime='[yy]yy-mm-dd\nhh:mm:ss']  [-nofilter]  [-sub]  [-up] [-avg] [-paeth] [-compression=n] [-compmemlevel=n]\n[-compstrategy={huffmanonly|filtered}]    [-compmethod=deflated]     [-compwindowbits=n]\n[-compbuffersize=n] [-force] [-libversion] [pnmfile]\n\n\n",
                "subsections": []
            },
            "OPTION USAGE": {
                "content": "Obsolete options:\n\n[-filter n]\n\nOptions available only in older versions:\n\n[-chroma wx wy rx ry gx gy bx by] [-phys x y unit] [-time [yy]yy-mm-dd\nhh:mm:ss]\n\nMinimum  unique  abbreviation of option is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This program is part of Netpbm(1).\n\npnmtopng reads a PNM image as input and produces a PNG image as output.\n\nColor component values in PNG files are either eight or sixteen bits wide, so  pnmtopng  will\nautomatically scale colors to have a maxval of 255 or 65535.\n\nFor  a  grayscale  image, pnmtopng produces a PNG bit depth 1, 2, 4, 8 or 16.  When the input\nimage has a small maxval, the output PNG image has a correspondingly small bit depth.  But in\nmapping the PNM maxval to the PNG maxval (which is by definition the maximum value  that  can\nbe  represented  in  the  number of bits), a fair amount of distortion happens with these low\nmaxvals.  For example, with a PNM maxval of 5 and a PNG maxval of 7, the input sample  2  be‐\ncomes the output sample 3.  The input brightness is 2/5 = .40, while the output brightness is\n3/7 = .43.  Note that this is not a problem if you view the maxval as a precision, because in\n.4  and  .43  are identical within the precision implied by maxval 5.  Indeed, if you convert\nthis PNG back to a maxval 5 PGM, the pixel's value will again be 2, exactly as it was  origi‐\nnally.  But if you need precisely the same colors in the output PNG as in the input PNM, make\nsure  your  input  PNM has a maxval which is a power of two minus one.  If you can't do that,\nthen convert it with pamdepth to something with a large maxval that is a power of  two  minus\none (255 and 65535 are good choices) to minimize the error.\n\n\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Note: Option Syntax of Older Versions",
                        "content": "pnmtopng  changed in Netpbm 10.30 (October 2005) to use the standard Netpbm command line syn‐\ntax.  Before that, you could not use double hyphens to denote an option and could not use  an\nequal sign to separate an option name from its value.  And the options had to come before the\nnon-option program arguments.\n\nFurthermore,  the  options  -chroma, -phys, and -time were replaced by -rgb, -size, and -mod‐\ntime, respectively.  The only difference, taking -phys/-size as an  example,  is  that  -phys\ntakes multiple program arguments as the option argument, whereas -size takes a single program\nargument which is composed of multiple words.  E.g. the old shell command\n\npnmtopng -phys 800 800 0 input.pnm > output.png\n\n\nis equivalent to the new shell command\n\npnmtopng -size \"800 800 0\" input.pnm > output.png\n\n\nIf you're writing a program that needs to work with both new and old , have it first try with\nthe new syntax, and if it fails with \"unrecognized option,\" fall back to the old syntax.\n\n"
                    },
                    {
                        "name": "Current Options",
                        "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), pnmtopng recognizes the following command line options:\n\n\n"
                    },
                    {
                        "name": "-verbose",
                        "content": "This causes pnmtopng to display information about the format of the output file.\n\n\n\n"
                    },
                    {
                        "name": "-downscale",
                        "content": "This enables pnmtopng to scale maxvalues of more then 65535 to  16  bits.  Since  this\nmeans loss of image data, pnmtopng does not do it by default.\n\n\n\n"
                    },
                    {
                        "name": "-interlace",
                        "content": "This  causes the PNG file to be interlaced, in Adam7 format.  The interlaced format is\none in which the raster data starts with a low-resolution representation of the entire\nimage, then continues with additional information for the entire image, then even more\ninformation, etc.  In Adam7 in particular, there are seven such passes  of  the  whole\nimage.  This is useful when you are receiving the image over a slow communication line\nas  someone  is  waiting to see it.  The simplest thing to do in that case is wait for\nthe entire image to arrive and then display it instantly, but then the user is wasting\ntime staring at a blank space until the whole image arrives.  With the  standard  non-\ninterlaced  format,  the data arrives row-by-row starting at the top, so the displayer\ncould display each row of the image as it arrives and gradually paint down to the bot‐\ntom.  But with an interlaced image, the displayer can start by showing  a  low-resolu‐\ntion version of the image, then gradually improve the display as more data arrives.\n\n\n\n"
                    },
                    {
                        "name": "-alpha=_",
                        "content": "This  specifies  the transparency (alpha) channel of the image.  You supply the trans‐\nparency channel as a standard PGM transparency mask  (see  the  PGM(1)  specification.\npnmtopng  does  not  necessarily  represents  the transparency information as a trans‐\nparency channel in the PNG format.  If it can represent the  transparency  information\nthrough  a  palette, it will do so in order to make a smaller PNG file.  pnmtopng even\nsorts the palette so it can omit the opaque colors from the transparency part  of  the\npalette and save space for the palette.\n\n\n\n"
                    },
                    {
                        "name": "-transparent=_",
                        "content": "pnmtopng marks the specified color as transparent in the PNG image.\n\nSpecify  the  color  (color) as described for the \u001b]8;;libnetpbmimage.html#colorname\u001b\\argument of the pnmparsecolor() li‐\nbrary routine\u001b]8;;\u001b\\ .  E.g. red or rgb:ff/00/0d.  If the color you specify is not present in\nthe image, pnmtopng selects instead the color in the image that is closest to the  one\nyou  specify.   Closeness  is  measured  as a Cartesian distance between colors in RGB\nspace.  If multiple colors are equidistant, pnmtopng chooses one of them arbitrarily.\n\nHowever, if you prefix your color specification with \"=\", e.g.\n\n-transparent =red\n\n\nonly the exact color you specify will be transparent.  If that color does not  appear\nin  the  image, there will be no transparency.  pnmtopng issues an information message\nwhen this is the case.\n\n"
                    },
                    {
                        "name": "-background=_",
                        "content": "Causes pnmtopng to create a background color chunk in the PNG output which can be used\nfor subsequent transparency channel or transparent color conversions.   Specify  color\nthe same as for -transparent.\n\n\n\n"
                    },
                    {
                        "name": "-palette=_",
                        "content": "This  option  specifies a palette to use in the PNG.  It forces pnmtopng to create the\npaletted (colormapped) variety of PNG -- if that isn't possible, pnmtopng  fails.   If\nthe  palette  you  specify  doesn't  contain exactly the colors in the image, pnmtopng\nfails.  Since pnmtopng will automatically generate a  paletted  PNG,  with  a  correct\npalette, when appropriate, the only reason you would specify the -palette option is if\nyou  care  in what order the colors appear in the palette.  The PNG palette has colors\nin the same order as the palette you specify.\n\nYou specify the palette by naming a PPM file that has one pixel for each color in  the\npalette.\n\nAlternatively,  consider  the  case that have a palette and you want to make sure your\nPNG contains only colors from the palette, approximating if necessary.  You don't care\nwhat indexes the PNG uses internally for  the  colors  (i.e.  the  order  of  the  PNG\npalette).   In  this  case,  you don't need -palette.  Pass the Netpbm input image and\nyour palette PPM through pnmremap.  Though you might think it would, using -palette in\nthis case wouldn't even save pnmtopng any work.\n\n"
                    },
                    {
                        "name": "-gamma=_",
                        "content": "Causes pnmtopng to create a gAMA chunk.  This information helps describe how the color\nvalues in the PNG must be interpreted.  Without the gAMA  chunk,  whatever  interprets\nthe  PNG must get this information separately (or just assume something standard).  If\nyour input is a true PPM or PGM image, you should specify -gamma=.52.   But  sometimes\npeople  generate  images  which  are  ostensibly PPM except the image uses a different\ngamma transfer function than the one specified for PPM.  A common case of this is when\nthe image is created by simple hardware that doesn't have digital computational  abil‐\nity.   Also, some simple programs that generate images from scratch do it with a gamma\ntransfer in which the gamma value is 1.0.\n\n\n\n"
                    },
                    {
                        "name": "-hist",
                        "content": "the colors in the image.\n\n\n\n"
                    },
                    {
                        "name": "-text=_",
                        "content": "This option lets you include arbitrary text strings in the PNG output, as tEXt chunks.\n\nfilename is the name of a file that contains your text strings.\n\nThe output contains a distinct tEXt chunk for each entry in the file.\n\nHere is an example of a text string file:\n\nTitle           PNG file\nAuthor          John Doe\nDescription     how to include a text chunk\nPNG file\n\"Creation Date\" 2015-may-11\nSoftware        pamtopng\n\n\nThe  file  is  divided  into entries, each entry comprising consecutive lines of text.\nThe first line of an entry starts in the first column (i.e. the first  column  is  not\nwhite  space) and every other line has white space in the first column.  The first en‐\ntry starts in the first line, so it is not valid for the first line  of  the  file  to\nhave white space in its first column.\n\nThe first word in an entry is the key of the text string (e.g. 'Title').  It begins in\ncolumn  one  of  the  line and continues up to, but not including, the first delimiter\ncharacter or the end of the line, whichever is first.  You can enclose the key in dou‐\nble quotes in which case the key can consists of multiple words.  The quotes  are  not\npart  of the key.  The text string per se begins after the key and any delimiter char‐\nacters after it, plus the text in subsequent continuation lines.\n\nThere is no limit on the length of a file line or entry or key or text string.   There\nis no limit on the number of entries.\n\n"
                    },
                    {
                        "name": "-ztxt=_",
                        "content": "The  same  as -text, except the text string is compressed in the PNG output.  pnmtopng\nuses zTXt chunks instead of a tEXt chunks, unless the key for the text  string  starts\nwith  'A' or 'T'.  This odd exception exists for backward compatibility; we don't know\nwhy the program was originally designed this way,  except  that  the  distinction  was\nmeant to roughly identify the keys 'Author' and 'Title'.\n\n\n\n"
                    },
                    {
                        "name": "-rgb=_",
                        "content": "This  option  specifies how red, green, and blue component values of a pixel specify a\nparticular color, by telling the chromaticities of those 3 primary illuminants and  of\nwhite (i.e. full strength of all three).\n\nThe  chromalist  value is a blank-separated list of 8 floating point decimal numbers:\nthe CIE-1931 X and Y chromaticities (in that order) of each of white, red, green,  and\nblue, in that order.\n\nThis information goes into the PNG's cHRM chunk.\n\nIn  a  shell  command,  make  sure  you  use  quotation  marks  so  that the blanks in\nchromalist don't make the shell see multiple command arguments.\n\nThis option was new in Netpbm 10.30 (October 2005).  Before that, the  option  -chroma\ndoes the same thing, but with slightly different syntax.\n\n"
                    },
                    {
                        "name": "-size=\"_",
                        "content": "This option determines the aspect ratio of the individual pixels of your image as well\nas the physical resolution of it.\n\nunit  is either 0 or 1.  When it is 1, the option specifies the physical resolution of\nthe image in pixels per meter.  For example, -size=\"10000 15000  1\"  means  that  when\nsomeone  displays  the image, he should make it so that 10,000 pixels horizontally oc‐\ncupy 1 meter and 15,000 pixels vertically occupy one meter.  And even  if  he  doesn't\ntake  this  advice on the overall size of the displayed image, he should at least make\nit so that each pixel displays as 1.5 times as high as wide.\n\nWhen unit is 0, that means there is no advice on  the  absolute  physical  resolution;\njust on the ratio of horizontal to vertical physical resolution.\n\nThis information goes into the PNG's pHYS chunk.\n\nWhen  you  don't  specify  -size, pnmtopng creates the image with no pHYS chunk, which\nmeans square pixels of no absolute resolution.\n\nThis option was new in Netpbm 10.30 (October 2005).  Before  that,  the  option  -phys\ndoes the same thing, but with slightly different syntax.\n\n"
                    },
                    {
                        "name": "-srgbintent=_",
                        "content": "This  asserts  that  the  input is a pseudo-Netpbm image that uses an sRGB color space\n(unlike true Netpbm) and indicates how you intend for the colors to be  rendered.   It\ncauses  pnmtopng to include an sRGB chunk in the PNG image that specifies that intent,\nso see the PNG documentation for more information on what this really means.\n\nintent is one of:\n\n\n\n•      perceptual\n\n•      relativecolorimetric\n\n•      saturation\n\n•      absolutecolorimetric\n\n\nThis option was new in Netpbm 10.71 (June 2015).  Before that, pnmtopng  never  gener‐\nates an sRGB chunk.\n\n"
                    },
                    {
                        "name": "-modtime=\"",
                        "content": "This  option allows you to specify the modification time value to be placed in the PNG\noutput.  You can specify the year parameter either as a two digit or four digit value.\n\nThis option was new in Netpbm 10.30 (October 2005).  Before  that,  the  option  -time\ndoes the same thing, but with slightly different syntax.\n\n"
                    },
                    {
                        "name": "-filter=_",
                        "content": "This  option  is obsolete.  Before Netpbm 10.22 (April 2004), this was the only way to\nspecify a row filter.  It specifies a single type of row filter, by number, that  pnm‐\ntopng must use on each row.\n\nUse -nofilter, -sub, -up, -avg, and -paeth in current Netpbm.\n\n"
                    },
                    {
                        "name": "-nofilter",
                        "content": ""
                    },
                    {
                        "name": "-sub",
                        "content": ""
                    },
                    {
                        "name": "-up",
                        "content": ""
                    },
                    {
                        "name": "-avg",
                        "content": ""
                    },
                    {
                        "name": "-paeth",
                        "content": "chooses whichever of the permitted filters it finds to be  optimal.   If  you  specify\nnone  of  these options, it is the same as specifying all of them -- pnmtopng uses any\nrow filter type it finds optimal.\n\nThese options were new with Netpbm 10.22 (April 2004).  Before that, you could use the\n-filter option to specify one permitted row filter type.  The default, when you  spec‐\nify no filter options, was the same.\n\n"
                    },
                    {
                        "name": "-compression=_",
                        "content": "This  option  sets  set the compression level of the zlib compression.  Select a level\nfrom 0 for no compression (maximum  speed)  to  9  for  maximum  compression  (minimum\nspeed).\n\nThe default is the default of the zlib library.\n\n"
                    },
                    {
                        "name": "-comp_mem_level=_",
                        "content": "This  option sets the memory usage level of the zlib compression.  Select a level from\n1 for minimum memory usage (and minimum speed) to 9  for  maximum  memory  usage  (and\nspeed).\n\nThe default is the default of the zlib library.\n\nThis option was new in Netpbm 10.30 (October 2005).\n\n"
                    },
                    {
                        "name": "-comp_strategy=",
                        "content": "This options sets the compression strategy of the zlib compression.  See Zlib documen‐\ntation for information on what these strategies are.\n\nThe default is the default of the zlib library.\n\nThis option was new in Netpbm 10.30 (October 2005).\n\n"
                    },
                    {
                        "name": "-comp_method=deflated",
                        "content": "This  option  does nothing.  It is here for mathematical completeness and for possible\nforward compatibility.  It theoretically selects the compression method  of  the  zlib\ncompression,  but  the  Z  library  knows only one method today, so there's nothing to\nchoose.\n\nThe default is the default of the zlib library.\n\nThis option was new in Netpbm 10.30 (October 2005).\n\n"
                    },
                    {
                        "name": "-comp_window_bits=_",
                        "content": "This option tells how big a window the zlib compression algorithm uses.  The value  is\nthe  base  2  logarithm  of the window size in bytes, so 8 means 256 bytes.  The value\nmust be from 8 to 15 (i.e. 256 bytes to 32K).\n\nSee Zlib documentation for details on what this window size is.\n\nThe default is the default of the zlib library.\n\nThis option was new in Netpbm 10.30 (October 2005).\n\n"
                    },
                    {
                        "name": "-comp_buffer_size",
                        "content": "This option determines in what size pieces pnmtopng does the  zlib  compression.   One\ncompressed  piece  goes  in each IDAT chunk in the PNG.  So the bigger this value, the\nfewer IDAT chunks your PNG will have.  Theoretically, this makes the PNG  smaller  be‐\ncause  1)  you have less per-IDAT-chunk overhead, and 2) the compression algorithm has\nmore data to work with.  But in reality, the difference will probably not  be  notice‐\nable above about 8K, which is the default.\n\nThe  value  n  is  the  size  of the compressed piece (i.e. the compression buffer) in\nbytes.\n\nThis option was new in Netpbm 10.30 (October 2005).\n\n\n"
                    },
                    {
                        "name": "-force",
                        "content": "as similar to the Netpbm input as possible.  For example, the PNG output will  not  be\npaletted and the transparency channel will be represented as a full transparency chan‐\nnel  even  if the information could be represented more succinctly with a transparency\nchunk.\n\n\n\n"
                    },
                    {
                        "name": "-libversion",
                        "content": "This option causes pnmtopng to display version information about itself  and  the  li‐\nbraries it uses, in addition to all its normal function.  Do not confuse this with the\nNetpbm common option -version, which causes the program to display version information\nabout the Netpbm library and do nothing else.\n\nYou  can't really use this option in a program that invokes pnmtopng and needs to know\nwhich version it is.  Its function has changed too much over the history of  pnmtopng.\nThe option is good only for human eyes.\n\n\n\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "pngtopam(1), pamtopng(1), pnmremap(1), pnmgamma(1), pnm(1)\n\nFor information on the PNG format, see \u001b]8;;http://schaik.com/png\u001b\\http://schaik.com/png\u001b]8;;\u001b\\ .\n\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Copyright (C) 1995-1997 by Alexander Lehmann and Willem van Schaik.\n",
                "subsections": []
            },
            "DOCUMENT SOURCE": {
                "content": "This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pnmtopng.html\n\nnetpbm documentation                        13 March 2019                    Pnmtopng User Manual(1)",
                "subsections": []
            }
        }
    }
}