{
    "content": [
        {
            "type": "text",
            "text": "# pgmnorm (info)\n\n## NAME\n\npnmnorm - normalize the contrast in a Netbpm image\n\n## SYNOPSIS\n\npnmnorm [-bpercent N | -bvalue N] [-wpercent N | -wvalue N] [-keephues]\n[-brightmax]\n[ppmfile]\nAll options can be abbreviated to their shortest  unique  prefix.   You\nmay use two hyphens instead of one to designate an option.  You may use\neither white space or an equals sign between an  option  name  and  its\nvalue.\n\n## DESCRIPTION\n\nReads a PNM image (PBM, PGM, or PPM).  Normalizes the contrast by forc-\ning the lightest pixels to white, the darkest pixels to black, and lin-\nearly rescaling the ones in between; and produces the same kind of file\nas output.  This is pretty useless for a PBM image.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pgmnorm",
        "section": "",
        "mode": "info",
        "summary": "pnmnorm - normalize the contrast in a Netbpm image",
        "synopsis": "pnmnorm [-bpercent N | -bvalue N] [-wpercent N | -wvalue N] [-keephues]\n[-brightmax]\n[ppmfile]\nAll options can be abbreviated to their shortest  unique  prefix.   You\nmay use two hyphens instead of one to designate an option.  You may use\neither white space or an equals sign between an  option  name  and  its\nvalue.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "ppmhist",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmhist/1/json"
            },
            {
                "name": "pgmhist",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pgmhist/1/json"
            },
            {
                "name": "pnmgamma",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmgamma/1/json"
            },
            {
                "name": "ppmbrighten",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmbrighten/1/json"
            },
            {
                "name": "ppmdim",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmdim/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": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 42,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pnmnorm - normalize the contrast in a Netbpm image\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "pnmnorm [-bpercent N | -bvalue N] [-wpercent N | -wvalue N] [-keephues]\n[-brightmax]\n\n[ppmfile]\n\nAll options can be abbreviated to their shortest  unique  prefix.   You\nmay use two hyphens instead of one to designate an option.  You may use\neither white space or an equals sign between an  option  name  and  its\nvalue.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Reads a PNM image (PBM, PGM, or PPM).  Normalizes the contrast by forc-\ning the lightest pixels to white, the darkest pixels to black, and lin-\nearly rescaling the ones in between; and produces the same kind of file\nas output.  This is pretty useless for a PBM image.\n\nThe program first determines a mapping of old brightness to new bright-\nness.   For each possible brightness of a pixel, the program determines\na corresponding brightness for the output image.\n\nThen for each pixel in the image, the program computes  a  color  which\nhas  the desired output brightness and puts that in the output.  With a\ncolor image, it is not always possible to compute such a color and  re-\ntain  any  semblance  of the original hue, so the brightest and dimmest\npixels may only approximate the desired brightness.\n\nNote that for a PPM image, this is different from separately  normaliz-\ning the individual color components.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "By  default,  the  darkest 2 percent of all pixels are mapped to black,\nand the lightest 1 percent are mapped to white.  You can override these\npercentages  by  using  the  -bpercent  and -wpercent flags, or you can\nspecify the exact pixel values to be mapped by using  the  -bvalue  and\n-wvalue  flags.   Appropriate  numbers for the flags can be gotten from\nthe ppmhist tool.  If you just  want  to  enhance  the  contrast,  then\nchoose  values  at elbows in the histogram; e.g. if value 29 represents\n3% of the image but value 30 represents 20%, choose 30 for bvalue.   If\nyou  want  to  lighten  the image, then set bvalue to 0 and just fiddle\nwith wvalue; similarly, to darken the image, set wvalue to  maxval  and\nplay with bvalue.\n\nThe  -keephues  option says to keep each pixel the same hue as it is in\nthe input; just adjust its intensity.  By default,  pnmnorm  normalizes\ncontrast  in  each  component independently (except that the meaning of\nthe -wpercent and -bpercent options are based on the  overall  intensi-\nties  of  the  colors, not each component taken separately).  So if you\nhave a color which is intensely red but dimly green, pnmnorm would make\nthe  red  more intense and the green less intense, so you end up with a\ndifferent hue than you started with.\n\nIf you specify -keephues, pnmnorm would likely leave this pixel  alone,\nsince its overall intensity is medium.\n\n-keephues  can  cause  clipping, because a certain color may be below a\ntarget intensity while one  of  its  components  is  saturated.   Where\nthat's  the  case, pnmnorm uses the maximum representable intensity for\nthe saturated component and the pixel ends up with less overall  inten-\nsity, and a different hue, than it is supposed to have.\n\nThis option is meaningless on grayscale images.\n\nBefore March 2002, there was no -keephues option.\n\nThe -brightmax option says to use the intensity of the most intense RGB\ncomponent of a pixel as the pixel's brightness.   By  default,  pnmnorm\nuses the luminosity of the color as its brightness.\n\nThis option is meaningless on grayscale images.\n\nBefore March 2002, there was no -brightmax option.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "ppmhist(1), pgmhist(1), pnmgamma(1), ppmbrighten(1), ppmdim(1), pnm(5)\n\n7 October 1993                      pnmnorm(1)",
                "subsections": []
            }
        }
    }
}