{
    "mode": "man",
    "parameter": "pnmscalefixed",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pnmscalefixed/1/json",
    "generated": "2026-10-05T01:23:29Z",
    "sections": {
        "NAME": {
            "content": "pnmscalefixed - scale a PNM file quickly\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npnmscalefixed  is like pamscale except that it uses fixed point arithmetic internally instead\nof floating point, which may make it run faster.  In turn, it is less accurate and  may  dis‐\ntort the image.  It also lacks many of the features of pamscale.\n\nUse  the  pamscale  user manual with pnmscalefixed.  This document only describes the differ‐\nence.  Avoid any feature mentioned in the pamscale manual as not existing before Netpbm 9.9.\n\npnmscalefixed uses fixed point 12 bit arithmetic.  By contrast, pamscale uses floating  point\narithmetic which on most machines is probably 24 bit precision.  This makes pnmscalefixed run\nfaster (30% faster in one experiment), but the imprecision can cause distortions at the right\nand bottom edges.\n\nThe  distortion  takes  the  following form: One pixel from the edge of the input is rendered\nlarger in the output than the scaling factor requires.  Consequently, the rest of  the  image\nis  smaller than the scaling factor requires, because the overall dimensions of the image are\nalways as requested.  This distortion will usually be very hard to see.\n\npnmscalefixed with the -verbose option tells you how much distortion there is.\n\nThe amount of distortion depends on the size of the input image and  how  close  the  scaling\nfactor is to an integral 1/4096th.\n\nIf  the scaling factor is an exact multiple of 1/4096, there is no distortion.  So, for exam‐\nple doubling or halving an image causes no distortion.  But reducing it or enlarging it by  a\nthird  would cause some distortion.  To consider an extreme case, scaling a 100,000 row image\ndown to 50,022 rows would create an output image with all of the input squeezed into the  top\n50,000 rows, and the last row of the input copied into the bottom 22 rows of output.\n\npnmscalefixed  could  probably  be modified to use 16 bit or better arithmetic without losing\nanything.  The modification would consist of a single constant in  the  source  code.   Until\nthere is a demonstrated need for that, though, the Netpbm maintainer wants to keep the safety\ncushion afforded by the original 12 bit precision.\n\npnmscalefixed does not have pamscale's -nomix option.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee  Common Options ), pnmscalefixed recognizes the following command line options:\n\n\n",
            "subsections": [
                {
                    "name": "-xsize",
                    "content": ""
                },
                {
                    "name": "-width",
                    "content": ""
                },
                {
                    "name": "-ysize",
                    "content": ""
                },
                {
                    "name": "-height",
                    "content": ""
                },
                {
                    "name": "-xscale",
                    "content": ""
                },
                {
                    "name": "-yscale",
                    "content": ""
                },
                {
                    "name": "-pixels",
                    "content": ""
                },
                {
                    "name": "-xysize",
                    "content": ""
                },
                {
                    "name": "-reduce",
                    "content": "These options determine the scale factors.  See the pamscale(1) user  manual  for  de‐\ntails.\n\n"
                },
                {
                    "name": "-verbose",
                    "content": "Report details of the transformation.\n\n\n"
                }
            ]
        },
        "HISTORY": {
            "content": "pnmscalefixed  was  originally pnmscale. In Netpbm 9.9 (November 2000) pnmscale was rewritten\nto use floating point arithmetic; the former fixed point arithmetic version was renamed  pnm‐\nscalefixed.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamscale(1), pamstretch(1), pamstretch-gen(1), pbmreduce(1), pbmpscale(1), pamenlarge(1), pn‐\nmscale(1), pnm(1), pam(1)\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/pnmscalefixed.html\n\nnetpbm documentation                        01 July 2020                Pnmscalefixed User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pnmscalefixed - scale a PNM file quickly",
    "flags": [
        {
            "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": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "These options determine the scale factors. See the pamscale(1) user manual for de‐ tails."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Report details of the transformation."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pamscale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamscale/1/json"
        },
        {
            "name": "pamstretch",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamstretch/1/json"
        },
        {
            "name": "pamstretch-gen",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamstretch-gen/1/json"
        },
        {
            "name": "pbmreduce",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmreduce/1/json"
        },
        {
            "name": "pbmpscale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmpscale/1/json"
        },
        {
            "name": "pamenlarge",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamenlarge/1/json"
        },
        {
            "name": "mscale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mscale/1/json"
        },
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        },
        {
            "name": "pam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pam/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Scale a PNM file quickly with possibly reduced quality.",
        "examples": [
            {
                "description": "Scale an image such that the result has the specified dimensions",
                "command": "pnmscalefixed {{-w|-width}} {{width}} {{-h|-height}} {{height}} {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Scale an image such that the result has the specified width, keeping the aspect ratio",
                "command": "pnmscalefixed {{-w|-width}} {{width}} {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Scale an image such that its width and height is changed by the specified factors",
                "command": "pnmscalefixed {{-xsc|-xscale}} {{x_factor}} {{-ysc|-yscale}} {{y_factor}} {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            }
        ]
    }
}