{
    "content": [
        {
            "type": "text",
            "text": "# pnmscale(1) (man)\n\n## TLDR\n\n> This command has been replaced by `pamscale`.\n\n- View documentation for `pamscale`:\n  `tldr pamscale`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** pnmscale - scale a portable anymap\n\n**Synopsis:** pnmscale scalefactor [pnmfile]\npnmscale -reduce reductionfactor [pnmfile]\npnmscale  [{-xsize=cols  |  -width=cols  |  -xscale=factor}]  [{-ysize=rows  | -height=rows |\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | fits within the box, while preserving its aspect ratio. |\n| — | — | — | that number of pixels. If the input image is already no more than that many pixels, pnmscale just copies it as output; p |\n\n## See Also\n\n- pnmscalefixed(1)\n- pamstretch(1)\n- pbmreduce(1)\n- pnmenlarge(1)\n- pnmsmooth(1)\n- pnmcut(1)\n- pnm(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines) — 2 subsections\n  - -yscale= (4 lines)\n  - -verbose -nomix (6 lines)\n- **DESCRIPTION** (26 lines) — 2 subsections\n  - -xysize (2 lines)\n  - -pixels (44 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\npnmscale - scale a portable anymap\n\n### SYNOPSIS\n\npnmscale scalefactor [pnmfile]\npnmscale -reduce reductionfactor [pnmfile]\npnmscale  [{-xsize=cols  |  -width=cols  |  -xscale=factor}]  [{-ysize=rows  | -height=rows |\n\n#### -yscale=\n\npnmscale -xysize cols rows [pnmfile]\npnmscale -pixels n [pnmfile]\n\nMiscellaneous options:\n\n#### -verbose -nomix\n\nMinimum unique abbreviation of option is acceptable.  You may use double  hypens  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### DESCRIPTION\n\nReads a PBM, PGM, or PPM image as input, scales it by the specified  factor  or  factors  and\nproduces  a PGM or PPM image as output.  If the input file is in color (PPM), the output will\nbe too, otherwise it will be grayscale (PGM).  This is true even if the input is a black  and\nwhite  bitmap (PBM), because the process of scaling can turn a combination of black and white\npixels into a gray pixel.\n\nIf you want PBM output, use pgmtopbm to convert pnmscale's output to PBM.  Also consider pbm‐‐\nreduce.\n\nYou can both enlarge (scale factor > 1) and reduce (scale factor < 1).\n\nWhen  you  specify an absolute size or scale factor for both dimensions, pnmscale scales each\ndimension independently without consideration of the aspect ratio.\n\nIf you specify one dimension as a pixel size and don't specify the other dimension,  pnmscale\nscales the unspecified dimension to preserve the aspect ratio.\n\nIf  you  specify  one dimension as a scale factor and don't specify the other dimension, pnm‐‐\nscale leaves the unspecified dimension unchanged from the input.\n\nIf you specify the scalefactor parameter instead of dimension options,  that  is  the  scale\nfactor for both dimensions.  It is equivalent to -xscale=scalefactor -yscale=scalefactor .\n\nSpecifying  the  -reduce reductionfactor option is equivalent to specifying the scalefactor\nparameter, where scalefactor is the reciprocal of reductionfactor.\n\n#### -xysize\n\nfits within the box, while preserving its aspect ratio.\n\n#### -pixels\n\nthat number of pixels.  If the input image is already no more than that many pixels, pnmscale\njust copies it as output; pnmscale does not scale up with -pixels.\n\nIf you enlarge by a factor of 3 or more, you should probably add a pnmsmooth step; otherwise,\nyou can see the original pixels in the resulting image.\n\nWhen the scale factor is not an integer (including all cases of scaling down), there are  two\nways to do the scaling.  Which one pnmscale does is controlled by its -nomix option.\n\nBy  default,  pnmscale mixes the colors of adjacent pixels to produce output pixels that con‐\ntain information from multiple input pixels.  This makes the image look more like it would if\nit  had infinite resolution.  Note that it means the output may contain colors that aren't in\nthe input at all.\n\nBut if you specify -nomix, pnmscale never mixes pixels.  Each output pixel  is  derived  from\none  input pixel.  If you're scaling up, pixels get duplicated.  If you're scaling down, pix‐\nels get omitted.  Note that this means the image is rather distorted.  If you scale up by 1.5\nhorizontally,  for  example, the even numbered input pixels are doubled in the output and the\nodd numbered ones are copied singly.\n\nWhen the scale factor is an integer (which means you're scaling up), the -nomix option has no\neffect  -- output pixels are always just N copies of the input pixels.  In this case, though,\nconsider using pamstretch instead of pnmscale to get the added pixels interpolated instead of\njust copied and thereby get a smoother enlargement.\n\npnmscale  with  -nomix  is  faster  than without, but pnmenlarge is faster still.  pnmenlarge\nworks only on integer enlargements.\n\nA useful application of pnmscale is to blur an image.  Scale it down  (without  -nomix  )  to\ndiscard some information, then scale it back up using pamstretch.\n\nOr  scale  it  back  up with pnmscale and create a \"pixelized\" image, which is sort of a com‐\nputer-age version of blurring.\n\n\n\nPRECISION\npnmscale uses floating point arithmetic internally.  There is a speed  cost  associated  with\nthis.   For some images, you can get the acceptable results (in fact, sometimes identical re‐\nsults) faster with pnmscalefixed, which uses fixed point arithmetic.  pnmscalefixed may, how‐\never, distort your image a little.  See pnmscalefixed's man page for a complete discussion of\nthe difference.\n\n### SEE ALSO\n\npnmscalefixed(1), pamstretch(1), pbmreduce(1), pnmenlarge(1), pnmsmooth(1), pnmcut(1), pnm(5)\n\n### AUTHOR\n\nCopyright (C) 1989, 1991 by Jef Poskanzer.\n\n\n\n04 November 2000                               pnmscale(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pnmscale",
        "section": "1",
        "mode": "man",
        "summary": "pnmscale - scale a portable anymap",
        "synopsis": "pnmscale scalefactor [pnmfile]\npnmscale -reduce reductionfactor [pnmfile]\npnmscale  [{-xsize=cols  |  -width=cols  |  -xscale=factor}]  [{-ysize=rows  | -height=rows |",
        "tldr_summary": "This command has been replaced by `pamscale`.",
        "tldr_examples": [
            {
                "description": "View documentation for `pamscale`",
                "command": "tldr pamscale"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "fits within the box, while preserving its aspect ratio."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "that number of pixels. If the input image is already no more than that many pixels, pnmscale just copies it as output; pnmscale does not scale up with -pixels. If you enlarge by a factor of 3 or more, you should probably add a pnmsmooth step; otherwise, you can see the original pixels in the resulting image. When the scale factor is not an integer (including all cases of scaling down), there are two ways to do the scaling. Which one pnmscale does is controlled by its -nomix option. By default, pnmscale mixes the colors of adjacent pixels to produce output pixels that con‐ tain information from multiple input pixels. This makes the image look more like it would if it had infinite resolution. Note that it means the output may contain colors that aren't in the input at all. But if you specify -nomix, pnmscale never mixes pixels. Each output pixel is derived from one input pixel. If you're scaling up, pixels get duplicated. If you're scaling down, pix‐ els get omitted. Note that this means the image is rather distorted. If you scale up by 1.5 horizontally, for example, the even numbered input pixels are doubled in the output and the odd numbered ones are copied singly. When the scale factor is an integer (which means you're scaling up), the -nomix option has no effect -- output pixels are always just N copies of the input pixels. In this case, though, consider using pamstretch instead of pnmscale to get the added pixels interpolated instead of just copied and thereby get a smoother enlargement. pnmscale with -nomix is faster than without, but pnmenlarge is faster still. pnmenlarge works only on integer enlargements. A useful application of pnmscale is to blur an image. Scale it down (without -nomix ) to discard some information, then scale it back up using pamstretch. Or scale it back up with pnmscale and create a \"pixelized\" image, which is sort of a com‐ puter-age version of blurring. PRECISION pnmscale uses floating point arithmetic internally. There is a speed cost associated with this. For some images, you can get the acceptable results (in fact, sometimes identical re‐ sults) faster with pnmscalefixed, which uses fixed point arithmetic. pnmscalefixed may, how‐ ever, distort your image a little. See pnmscalefixed's man page for a complete discussion of the difference."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pnmscalefixed",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmscalefixed/1/json"
            },
            {
                "name": "pamstretch",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamstretch/1/json"
            },
            {
                "name": "pbmreduce",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pbmreduce/1/json"
            },
            {
                "name": "pnmenlarge",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmenlarge/1/json"
            },
            {
                "name": "pnmsmooth",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmsmooth/1/json"
            },
            {
                "name": "pnmcut",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmcut/1/json"
            },
            {
                "name": "pnm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "-yscale=",
                        "lines": 4
                    },
                    {
                        "name": "-verbose -nomix",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 26,
                "subsections": [
                    {
                        "name": "-xysize",
                        "lines": 2
                    },
                    {
                        "name": "-pixels",
                        "lines": 44
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}