{
    "mode": "man",
    "parameter": "ppmtoxpm",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ppmtoxpm/1/json",
    "generated": "2026-05-30T06:06:46Z",
    "synopsis": "ppmtoxpm [-name=xpmname] [-rgb=rgb-textfile] [-alphamask=pgmfile] [ppmfile]\nMinimum unique abbrevations are acceptable.",
    "sections": {
        "NAME": {
            "content": "ppmtoxpm - convert a portable pixmap into an X11 pixmap\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ppmtoxpm [-name=xpmname] [-rgb=rgb-textfile] [-alphamask=pgmfile] [ppmfile]\n\nMinimum unique abbrevations are acceptable.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  portable  pixmap  as input.  Produces X11 pixmap (version 3) as output which can be\nloaded directly by the XPM library.\n\n\nFor example, to convert the file \"dot\" (found in /usr/include/X11/bitmaps), from xbm  to  xpm\none could specify\n\nxbmtopbm dot | ppmtoxpm -name dot\n\nor, with a rgb text file (in the local directory)\n\nxbmtopbm dot | ppmtoxpm -name dot -rgb rgb.txt\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-name=",
                    "content": "The  -name  option allows you to specify the prefix string which is printed in the re‐\nsulting XPM output.  If not specified, will default to the  filename  (without  exten‐\nsion)  of  the <ppmfile> argument.  If you do not specify -name or ppmfile, (i.e. your\ninput is from Standad Input), the prefix string defaults to the string noname.\n\nrgb=rgb-textfile\nThe -rgb option allows you to specify an X11 rgb text file for  the  lookup  of  color\nname  mnemonics.   This rgb text file is typically the /usr/lib/X11/rgb.txt of the MIT\nX11 distribution, but any file using the same format may be used.  When specified  and\na  RGB  value from the ppm input matches a RGB value from the <rgb-textfile>, then the\ncorresponding color name mnemonic is printed in the  XPM's  colormap.   If  you  don't\nspecify -rgb or if the RGB values don't match, then ppmtoxpm produces the color speci‐‐\nfications in the #RGB, #RRGGBB, #RRRGGGBBB, or #RRRRGGGGBBBB hexadecimal format.\n\n"
                },
                {
                    "name": "-alphamask=",
                    "content": "This option names a PGM file to use as an alpha (transparency) mask.   The  file  must\ncontain  an image the same dimensions as the input image.  ppmtoxpm marks as transpar‐\nent any pixel whose position in the alpha mask image is at most half white.\n\nIf you don't specify -alphamask, ppmtoxpm makes all pixels in the output opaque.\n\nppmcolormask is one way to generate an alpha mask file.  You might also generate it by\nextracting transparency information from an XPM file with the -alphaout option to xpm‐‐\ntoppm.  There are similar options on other Netpbm converters that convert from formats\nthat include transparency information too.\n\n"
                }
            ]
        },
        "LIMITATIONS": {
            "content": "An  option  to  match  the  closest (rather than exact) color name mnemonic from the rgb text\nwould be a desirable enhancement.\n\nTruncation of the least significant bits of a RGB value may result in nonexact  matches  when\nperforming color name mnemonic lookups.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ppmcolormask(1), xpmtoppm(1), ppm(5)\nXPM Manual by Arnaud Le Hors lehors@mirsa.inria.fr\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (C) 1990 by Mark W. Snitily.\n\nPermission  to  use, copy, modify, and distribute this software and its documentation for any\npurpose and without fee is hereby granted, provided that the above copyright notice appear in\nall  copies and that both that copyright notice and this permission notice appear in support‐\ning documentation.  This software is provided \"as is\" without express or implied warranty.\n\nThis tool was developed for Schlumberger Technologies, ATE Division, and with  their  permis‐\nsion is being made available to the public with the above copyright notice and permission no‐\ntice.\n\nUpgraded to XPM2 by\nPaul Breslaw, Mecasoft SA, Zurich, Switzerland (paul@mecazh.uu.ch)\nThu Nov  8 16:01:17 1990\n\nUpgraded to XPM version 3 by\nArnaud Le Hors (lehors@mirsa.inria.fr)\nTue Apr 9 1991\n\n\n\n\nTue Apr 9 1991                                ppmtoxpm(1)",
            "subsections": []
        }
    },
    "summary": "ppmtoxpm - convert a portable pixmap into an X11 pixmap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "The -name option allows you to specify the prefix string which is printed in the re‐ sulting XPM output. If not specified, will default to the filename (without exten‐ sion) of the <ppmfile> argument. If you do not specify -name or ppmfile, (i.e. your input is from Standad Input), the prefix string defaults to the string noname. rgb=rgb-textfile The -rgb option allows you to specify an X11 rgb text file for the lookup of color name mnemonics. This rgb text file is typically the /usr/lib/X11/rgb.txt of the MIT X11 distribution, but any file using the same format may be used. When specified and a RGB value from the ppm input matches a RGB value from the <rgb-textfile>, then the corresponding color name mnemonic is printed in the XPM's colormap. If you don't specify -rgb or if the RGB values don't match, then ppmtoxpm produces the color speci‐‐ fications in the #RGB, #RRGGBB, #RRRGGGBBB, or #RRRRGGGGBBBB hexadecimal format."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option names a PGM file to use as an alpha (transparency) mask. The file must contain an image the same dimensions as the input image. ppmtoxpm marks as transpar‐ ent any pixel whose position in the alpha mask image is at most half white. If you don't specify -alphamask, ppmtoxpm makes all pixels in the output opaque. ppmcolormask is one way to generate an alpha mask file. You might also generate it by extracting transparency information from an XPM file with the -alphaout option to xpm‐‐ toppm. There are similar options on other Netpbm converters that convert from formats that include transparency information too."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ppmcolormask",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppmcolormask/1/json"
        },
        {
            "name": "xpmtoppm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xpmtoppm/1/json"
        },
        {
            "name": "ppm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/ppm/5/json"
        }
    ]
}