{
    "content": [
        {
            "type": "text",
            "text": "# ppmtogif(1) (man)\n\n**Summary:** ppmtogif - convert a portable pixmap into a GIF file\n\n**Synopsis:** ppmtogif [-interlace] [-sort] [-map mapfile]\n[-transparent [=]color] [-alpha pgmfile] [-comment text] [-nolzw]\n[ppmfile]\nAll  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐\nstead of one to designate an option.  You may use either white space or equals signs  between\nan option name and its value.\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | Produce an interlaced GIF file. |\n| — | — | — |  |\n| — | — | — | Uses the colors found in the mapfile to create the colormap in the GIF file, instead of the colors from ppmfile. The map |\n| — | — | — | ppmtogif marks the specified color as transparent in the GIF image. If you don't specify -transparent, ppmtogif does not |\n| — | — | — | This option names a PGM file that contains an alpha mask for the image. ppmtogif Cre‐ ates fully transparent pixels wher |\n| — | — | — | See -alpha. |\n| — | — | — | Include a comment in the GIF output with comment text text. Without this option, there are no comments in the output. |\n| — | — | — | pression. As a result, the image file is larger and no royalties are owed to the holder of the patent on LZW. See the se |\n\n## See Also\n\n- giftopnm(1)\n- ppmquant(1)\n- pngtopnm(1)\n- gifsicle(1)\n- ppm(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (9 lines)\n- **DESCRIPTION** (7 lines) — 1 subsections\n  - -comment (3 lines)\n- **OPTIONS** (1 lines) — 8 subsections\n  - -interlace (2 lines)\n  - -sort (1 lines)\n  - -map (8 lines)\n  - -transparent (22 lines)\n  - -alpha= (15 lines)\n  - -alphacolor (3 lines)\n  - -comment (4 lines)\n  - -nolzw (15 lines)\n- **SEE ALSO** (2 lines)\n- **AUTHOR** (8 lines)\n- **LICENSE** (13 lines)\n\n## Full Content\n\n### NAME\n\nppmtogif - convert a portable pixmap into a GIF file\n\n### SYNOPSIS\n\nppmtogif [-interlace] [-sort] [-map mapfile]\n[-transparent [=]color] [-alpha pgmfile] [-comment text] [-nolzw]\n[ppmfile]\n\nAll  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐\nstead of one to designate an option.  You may use either white space or equals signs  between\nan option name and its value.\n\n### DESCRIPTION\n\nReads a portable pixmap as input.  Produces a GIF file as output.\n\nThis program creates only individual GIF images.  To combine multiple GIF images into an ani‐\nmated GIF, use gifsicle (not part of the Netpbm package).\n\nppmtogif creates either an original GIF87 format GIF file or the newer GIF89 format.  It cre‐\nates  GIF89  when  you  request features that were new with GIF89, to wit the -transparent or\n\n#### -comment\n\nrecognize GIF89.\n\n### OPTIONS\n\n#### -interlace\n\nProduce an interlaced GIF file.\n\n#### -sort\n\n#### -map\n\nUses  the  colors found in the mapfile to create the colormap in the GIF file, instead\nof the colors from ppmfile.  The mapfile can be any ppm file; all that matters is  the\ncolors  in  it.  If  the  colors  in  ppmfile do not match those in mapfile , they are\nmatched to a \"best match.\" A (much) better result can be obtained by using the follow‐\ning filter in advance:\n\nppmquant -floyd -map mapfile\n\n#### -transparent\n\nppmtogif marks the specified color as transparent in the GIF image.\n\nIf  you  don't specify -transparent, ppmtogif does not mark any color transparent (ex‐\ncept as indicated by the -alpha option).\n\nYou specify the color as in ppmmake(1).E.g.  red or rgb:ff/00/0d.  If  the  color  you\nspecify  is  not present in the image, ppmtogif selects instead the color in the image\nthat is closest to the one you specify.  Closeness is measured as a cartesian distance\nbetween colors in RGB space.  If multiple colors are equidistant, ppmtogif chooses one\nof them arbitrarily.\n\nHowever, if you prefix your color specification with \"=\", e.g.\n\n-transparent==red\n\nOnly the exact color you specify will be transparent.  If that color does  not  appear\nin  the  image, there will be no transparency.  ppmtogif issues an information message\nwhen this is the case.\n\nYou cannot specify both -transparent and -alpha.\n\n#### -alpha=\n\nThis option names a PGM file that contains an alpha mask for the image.  ppmtogif Cre‐\nates  fully  transparent pixels wherever the alpha mask indicates transparency greater\nthan 50%.  The color of those pixels is that specified by the -alphacolor  option,  or\nblack by default.\n\nTo  do  this, ppmtogif creates an entry in the GIF colormap in addition to the entries\nfor colors that are actually in the image.  It marks that colormap entry as  transpar‐\nent and uses that colormap index in the output image to create a transparent pixel.\n\nThe  alpha image must be the same dimensions as the input image, but may have any max‐\nval.  White means opaque and black means transparent.\n\nYou cannot specify both -transparent and -alpha.\n\n#### -alphacolor\n\nSee -alpha.\n\n#### -comment\n\nInclude a comment in the GIF output with comment  text  text.   Without  this  option,\nthere are no comments in the output.\n\n#### -nolzw\n\npression.  As a result, the image file is larger and no  royalties  are  owed  to  the\nholder of the patent on LZW.  See the section LICENSE below.\n\nLZW  is  a method for combining the information from multiple pixels into a single GIF\ncode.  With the -nolzw option, ppmtogif creates one GIF code per pixel, so it  is  not\ndoing any compression and not using LZW.  However, any GIF decoder, whether it uses an\nLZW decompressor or not, will correctly decode this uncompressed format.  An  LZW  de‐\ncompressor would see this as a particular case of LZW compression.\n\nNote  that  if  someone uses an LZW decompressor such as the one in ppmtogif or pretty\nmuch any graphics display program to process the output of ppmtogif -nolzw he is  then\nusing  the  LZW  patent.  But the patent holder has expressed far less interest in en‐\nforcing the patent on decoding than on encoding.\n\n### SEE ALSO\n\ngiftopnm(1), ppmquant(1), pngtopnm(1), gifsicle(1) <http://www.lcdf.org/gifsicle>, ppm(5).\n\n### AUTHOR\n\nBased on GIFENCOD by  David  Rowley  <mgardi@watdcsu.waterloo.edu>.   Lempel-Ziv  compression\nbased on \"compress\".\n\nThe non-LZW format is generated by code based on djpeg by the Independent Jpeg Group.\n\nCopyright (C) 1989 by Jef Poskanzer.\n\n### LICENSE\n\nIf  you use ppmtogif without the -nolzw option, you are using a patent on the LZW compression\nmethod which is owned by Unisys, and in all probability you do not have a license from Unisys\nto  do  so.  Unisys typically asks $5000 for a license for trivial use of the patent.  Unisys\nhas never enforced the patent against trivial users.  The patent expires in 2003.\n\nRumor has it that IBM also owns a patent covering ppmtogif.\n\nA replacement for the GIF format that does not require any patents to use is the PNG format.\n\n\n\n\n20 May 2000                                 ppmtogif(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "ppmtogif",
        "section": "1",
        "mode": "man",
        "summary": "ppmtogif - convert a portable pixmap into a GIF file",
        "synopsis": "ppmtogif [-interlace] [-sort] [-map mapfile]\n[-transparent [=]color] [-alpha pgmfile] [-comment text] [-nolzw]\n[ppmfile]\nAll  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐\nstead of one to designate an option.  You may use either white space or equals signs  between\nan option name and its value.",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Produce an interlaced GIF file."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Uses the colors found in the mapfile to create the colormap in the GIF file, instead of the colors from ppmfile. The mapfile can be any ppm file; all that matters is the colors in it. If the colors in ppmfile do not match those in mapfile , they are matched to a \"best match.\" A (much) better result can be obtained by using the follow‐ ing filter in advance: ppmquant -floyd -map mapfile"
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "ppmtogif marks the specified color as transparent in the GIF image. If you don't specify -transparent, ppmtogif does not mark any color transparent (ex‐ cept as indicated by the -alpha option). You specify the color as in ppmmake(1).E.g. red or rgb:ff/00/0d. If the color you specify is not present in the image, ppmtogif 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, ppmtogif 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. ppmtogif issues an information message when this is the case. You cannot specify both -transparent and -alpha."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option names a PGM file that contains an alpha mask for the image. ppmtogif Cre‐ ates fully transparent pixels wherever the alpha mask indicates transparency greater than 50%. The color of those pixels is that specified by the -alphacolor option, or black by default. To do this, ppmtogif creates an entry in the GIF colormap in addition to the entries for colors that are actually in the image. It marks that colormap entry as transpar‐ ent and uses that colormap index in the output image to create a transparent pixel. The alpha image must be the same dimensions as the input image, but may have any max‐ val. White means opaque and black means transparent. You cannot specify both -transparent and -alpha."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See -alpha."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Include a comment in the GIF output with comment text text. Without this option, there are no comments in the output."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "pression. As a result, the image file is larger and no royalties are owed to the holder of the patent on LZW. See the section LICENSE below. LZW is a method for combining the information from multiple pixels into a single GIF code. With the -nolzw option, ppmtogif creates one GIF code per pixel, so it is not doing any compression and not using LZW. However, any GIF decoder, whether it uses an LZW decompressor or not, will correctly decode this uncompressed format. An LZW de‐ compressor would see this as a particular case of LZW compression. Note that if someone uses an LZW decompressor such as the one in ppmtogif or pretty much any graphics display program to process the output of ppmtogif -nolzw he is then using the LZW patent. But the patent holder has expressed far less interest in en‐ forcing the patent on decoding than on encoding."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "giftopnm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/giftopnm/1/json"
            },
            {
                "name": "ppmquant",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmquant/1/json"
            },
            {
                "name": "pngtopnm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pngtopnm/1/json"
            },
            {
                "name": "gifsicle",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gifsicle/1/json"
            },
            {
                "name": "ppm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/ppm/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "-comment",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-interlace",
                        "lines": 2
                    },
                    {
                        "name": "-sort",
                        "lines": 1
                    },
                    {
                        "name": "-map",
                        "lines": 8
                    },
                    {
                        "name": "-transparent",
                        "lines": 22
                    },
                    {
                        "name": "-alpha=",
                        "lines": 15
                    },
                    {
                        "name": "-alphacolor",
                        "lines": 3
                    },
                    {
                        "name": "-comment",
                        "lines": 4
                    },
                    {
                        "name": "-nolzw",
                        "lines": 15
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 13,
                "subsections": []
            }
        ]
    }
}