{
    "content": [
        {
            "type": "text",
            "text": "# pgmtopbm(1) (man)\n\n**Summary:** pgmtopbm - convert a portable graymap into a portable bitmap\n\n**Synopsis:** pgmtopbm  [-floyd|-fs|-threshold |-hilbert |-dither8|-d8|-cluster3 |-c3|-cluster4|-c4 |-clus‐‐\nter8|-c8] [-value val] [-clump size] [pgmfile]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | with a 16x16 matrix; and three different sizes of 45-degree clustered-dot dither (-cluster3, |\n| — | — | — | also available. (-hilbert); Floyd-Steinberg will almost always give the best looking results; however, looking good is n |\n\n## See Also\n\n- pbmreduce(1)\n- pgm(5)\n- pbm(5)\n- pnmconvol(1)\n- pnmscale(1)\n- pnmtops(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (12 lines)\n- **OPTIONS** (1 lines) — 2 subsections\n  - -fs -threshold -dither8 (1 lines)\n  - -cluster4 -cluster8 (23 lines)\n- **REFERENCES** (7 lines)\n- **SEE ALSO** (2 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\npgmtopbm - convert a portable graymap into a portable bitmap\n\n### SYNOPSIS\n\npgmtopbm  [-floyd|-fs|-threshold |-hilbert |-dither8|-d8|-cluster3 |-c3|-cluster4|-c4 |-clus‐‐\nter8|-c8] [-value val] [-clump size] [pgmfile]\n\n### DESCRIPTION\n\nReads a portable graymap as input.  Produces a portable bitmap as output.\n\nNote that there is no pbmtopgm converter.  Any program that uses the Netpbm libraries to read\nPGM files, including virtually all programs in the Netpbm package, will read a PBM file auto‐\nmatically as if it were a PGM file.\n\nIf you are using a less intelligent program that expects PGM input, use pnmdepth  to  convert\nthe  PBM  file  to  PGM.  As long as the depth is greater than 1, pnmdepth will generate PGM.\nThis less intelligent program quite probably is also not intelligent enough to deal with gen‐\neral maxvals, so you should specify a depth of 255.\n\n### OPTIONS\n\nThe default quantization method is boustrophedonic Floyd-Steinberg error diffusion (-floyd or\n\n#### -fs -threshold -dither8\n\nwith  a 16x16 matrix; and three different sizes of 45-degree clustered-dot dither (-cluster3,\n\n#### -cluster4 -cluster8\n\nalso available.  (-hilbert);\n\nFloyd-Steinberg  will  almost  always give the best looking results; however, looking good is\nnot always what you want.  For instance, thresholding can be used in a pipeline with the pnm‐\nconvol  tool,  for  tasks  like edge and peak detection.  And clustered-dot dithering gives a\nnewspaper-ish look, a useful special effect.\n\nThe -value flag alters the thresholding value for Floyd-Steinberg  and  simple  thresholding.\nIt  should  be a real number between 0 and 1.  Above 0.5 means darker images; below 0.5 means\nlighter.\n\nThe Hilbert curve method is useful for processing images before display on  devices  that  do\nnot render individual pixels distinctly (like laser printers). This dithering method can give\nbetter results than the dithering usually done by the laser printers themselves.  The  -clump\nflag  alters  the  number  of pixels in a clump. This is usually an integer between 2 and 100\n(default 5). Smaller clump sizes smear the image less and are less grainy, but seem to  loose\nsome  grey  scale  linearity.  Typically a PGM image will have to be scaled to fit on a laser\nprinter page (2400 x 3000 pixels for an A4 300 dpi page), and then dithered to  a  PBM  image\nbefore  being converted to a postscript file.  A printing pipeline might look something like:\npnmscale -xysize 2400 3000 image.pgm | pgmtopbm -hil | pnmtops -scale 0.25 > image.ps\n\nAll flags can be abbreviated to their shortest unique prefix.\n\n### REFERENCES\n\nThe only reference you need for this stuff is \"Digital Halftoning\" by  Robert  Ulichney,  MIT\nPress, ISBN 0-262-21009-6.\n\nThe  Hilbert  curve space filling method is taken from \"Digital Halftoning with Space Filling\nCurves\" by Luiz Velho, Computer Graphics Volume 25, Number 4,  proceedings  of  SIGRAPH  '91,\npage 81. ISBN 0-89791-436-8\n\n### SEE ALSO\n\npbmreduce(1), pgm(5), pbm(5), pnmconvol(1), pnmscale(1), pnmtops(1)\n\n### AUTHOR\n\nCopyright (C) 1989 by Jef Poskanzer.\n\n\n\n26 July 1988                                 pgmtopbm(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pgmtopbm",
        "section": "1",
        "mode": "man",
        "summary": "pgmtopbm - convert a portable graymap into a portable bitmap",
        "synopsis": "pgmtopbm  [-floyd|-fs|-threshold |-hilbert |-dither8|-d8|-cluster3 |-c3|-cluster4|-c4 |-clus‐‐\nter8|-c8] [-value val] [-clump size] [pgmfile]",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "with a 16x16 matrix; and three different sizes of 45-degree clustered-dot dither (-cluster3,"
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "also available. (-hilbert); Floyd-Steinberg will almost always give the best looking results; however, looking good is not always what you want. For instance, thresholding can be used in a pipeline with the pnm‐ convol tool, for tasks like edge and peak detection. And clustered-dot dithering gives a newspaper-ish look, a useful special effect. The -value flag alters the thresholding value for Floyd-Steinberg and simple thresholding. It should be a real number between 0 and 1. Above 0.5 means darker images; below 0.5 means lighter. The Hilbert curve method is useful for processing images before display on devices that do not render individual pixels distinctly (like laser printers). This dithering method can give better results than the dithering usually done by the laser printers themselves. The -clump flag alters the number of pixels in a clump. This is usually an integer between 2 and 100 (default 5). Smaller clump sizes smear the image less and are less grainy, but seem to loose some grey scale linearity. Typically a PGM image will have to be scaled to fit on a laser printer page (2400 x 3000 pixels for an A4 300 dpi page), and then dithered to a PBM image before being converted to a postscript file. A printing pipeline might look something like: pnmscale -xysize 2400 3000 image.pgm | pgmtopbm -hil | pnmtops -scale 0.25 > image.ps All flags can be abbreviated to their shortest unique prefix."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pbmreduce",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pbmreduce/1/json"
            },
            {
                "name": "pgm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pgm/5/json"
            },
            {
                "name": "pbm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pbm/5/json"
            },
            {
                "name": "pnmconvol",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmconvol/1/json"
            },
            {
                "name": "pnmscale",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmscale/1/json"
            },
            {
                "name": "pnmtops",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmtops/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-fs -threshold -dither8",
                        "lines": 1
                    },
                    {
                        "name": "-cluster4 -cluster8",
                        "lines": 23
                    }
                ]
            },
            {
                "name": "REFERENCES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}