{
    "mode": "man",
    "parameter": "pnmtopalm",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/pnmtopalm/json",
    "generated": "2026-10-24T02:37:20Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "pnmtopalm - convert a PNM image to a Palm Bitmap\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "pnmtopalm",
                    "content": "[-verbose]\n\n[-depth=N]\n\n[-maxdepth=N]\n\n[-colormap]\n\n[-transparent=colorspec]\n\n[-density=N]\n\n[-offset]\n\n[-withdummy] [-scanlinecompression | -rlecompression | -packbitscompression]\n\n[pnmfile]\n\nMinimum  unique  abbreviation of option is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npnmtopalm reads a PNM image as input, from Standard Input or  pnmfile  and  produces  a  Palm\nBitmap as output.\n\nPalm  Bitmap files are either grayscale files with 1, 2, or 4 bits per pixel, or mapped color\nfiles with 8 bit per pixel, or a direct color file with 16  bits  per  pixel,  and  pnmtopalm\nchooses  this  color  depth based on the maxval and number of colors in the input, unless you\nspecify a depth (bits per pixel) with -depth.  You can also  specify  a  maximum  depth  with",
            "subsections": [
                {
                    "name": "-maxdepth",
                    "content": "number and set of colors for the selected output constraints.\n\nThis often means that you should run the PNM image through pnmquant or  pnmremap  before  you\npass it to pnmtopalm.  Netpbm comes with several colormap files you can use with pnmremap for\nthis  purpose.  They are palmgray2.map (4 shades of gray for a depth of 2), palmgray4.map (16\nshades of gray for a depth of 4), and palmcolor8.map (232 colors in default  Palm  colormap).\nIn  a  standard Netpbm installation, these are in the Netpbm data directory, and you can find\nthe Netpbm data directory with a netpbm-config --datadir shell command.\n\nExample:\n\npnmremap myimage.ppm \\\n-mapfile=$(netpbm-config --datadir)/palmgray2.map \\\n| pnmtopalm -depth=2 >myimage.palm\n\n\n\nCompressed Palm Bitmap files, at least the ones pnmtopalm knows how to  create,  cannot  have\nmore  than  8  bits  per pixel.  pnmtopalm defaults to 8 bits per pixel if you specify a com‐\npressed output.  You can specify the  number  of  bits  per  pixel  explicitly  with  -depth."
                },
                {
                    "name": "-maxdepth   -depth",
                    "content": "ther of these, pnmtopalm fails.\n\n"
                },
                {
                    "name": "Palm Bitmap Version",
                    "content": "pnmtopalm generates a Version 0, 1, 2, or 3 Palm Bitmap.  It generates  the  oldest  (lowest)\nversion it can for the given image and the options you specify.\n\n\n\n•      If  you specify a density (-density option) higher than \"low,\" the version is at least\n3.\n\n\n•      If you specify transparency (-transparent option) or any compression, the  version  is\nat least 2.\n\n\n•      If you specify a custom colormap (-colormap option), the version is at least 1.\n\n\n•      If  the  image  has more than one bit per pixel, the version is at least 1.  The image\nhas more than one bit per pixel if you specify it with -depth or if you let it default\nand the image has more than two colors (or shades of gray).\n\n\n\nAll releases of Palm OS can read a Version 0 bitmap.  Palm OS 3.0 and later can read  a  Ver‐\nsion  1  bitmap.   Palm  OS  3.5  and later can read a Version 2 bitmap.  To read a Version 3\nbitmap, you need Palm OS Garnet or a handheld running the High Density Display Feature Set.\n\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,\nsee  Common Options ), pnmtopalm recognizes the following command line options:\n\n\n",
            "subsections": [
                {
                    "name": "-verbose",
                    "content": "Display the format of the output file.\n\n"
                },
                {
                    "name": "-depth=_",
                    "content": "Produce  a file of depth N, where N must be either 1, 2, 4, 8, or 16.  Because the de‐\nfault Palm 8-bit colormap is not grayscale, if the input is a grayscale or  monochrome\nimage,  the  output  will  never be more than 4 bits deep, regardless of the specified\ndepth.  Note that 8-bit color works only in PalmOS 3.5 (and higher), and 16-bit direct\ncolor works only in PalmOS 4.0 (and higher).  However, the 16-bit direct color  format\nis  also compatible with the various PalmOS 3.x versions used in the Handspring Visor,\nso these images may also work in that device.\n\n"
                },
                {
                    "name": "-maxdepth=_",
                    "content": "Produce a file of minimal depth, but in any case less than N bits wide.  If you  spec‐\nify 16-bit, the output will always be 16-bit direct color.\n\n"
                },
                {
                    "name": "-offset",
                    "content": "Set  the nextDepthOffset field in the palm file header to indicate the end of the file\n(and pad the end of the file to 4 bytes, since nextDepthOffset can  point  only  to  4\nbyte boundaries).\n\nA  palm  image  file can contain multiple renditions of the same image, with different\ncolor  depths,  so  a  viewer  can  choose  one  appropriate  for  the  display.   The\nnextDepthOffset field tells where in the stream the next rendition begins.\n\npnmtopalm creates a file that contains only one image, but you can separately concate‐\nnate  multiple  one-image  files to create a multi-image file.  If you do that, you'll\nneed to use -offset so that the resulting concatenation is a correct stream.\n\nBy default (if you don't specify -offset), pnmtopalm generates a nextDepthOffset field\nthat says there is no following image (and does not add any padding after the image).\n\nVersion 3  Palm  Bitmaps  actually  have  a  nextBitmapOffset  field  instead  of  the\nnextDepthOffset.  The foregoing applies to whichever is relevant.\n\nThe -offset option was new in Netpbm 10.26 (January 2005).  Before that, pnmtopalm al‐\nways set the nextDepthOffset field to \"none.\"\n\nBefore  Netpbm  10.27  (March 2005), you cannot use -offset if you create a compressed\nraster (because pnmtopalm isn't smart enough to be able to know the size of the  image\nat  the time it writes the header).  You also cannot use it with 16 bit color depth or\nwith the -colormap option, for much the same reason.\n\n"
                },
                {
                    "name": "-withdummy",
                    "content": "This option tells pnmtopalm to put in the stream,  after  the  image,  a  dummy  image\nheader to introduce subsequent high density images.\n\nThis dummy image header is a special sequence specified in Palm Bitmap specifications.\nIt  looks to an older Palm Bitmap interpreter like an invalid image header, so such an\ninterpreter will stop reading the stream there.  But a  new  Palm  Bitmap  interpreter\nrecognizes  it  for  what it is (just something to choke an old interpreter) and skips\nover it.  Presumably, you will add to the stream after this high density images  which\nwould confuse an older interpreter.\n\nIf  you  specify  -withdummy, you must also specify -offset, since it doesn't make any\nsense otherwise.\n\n-withdummy was new in Netpbm 10.27 (March 2005).\n\n"
                },
                {
                    "name": "-colormap",
                    "content": "Build a custom colormap and include it in the output file.  This is not recommended by\nPalm, for efficiency reasons.  Otherwise, pnmtopalm uses the default Palm colormap for\ncolor output.\n\n"
                },
                {
                    "name": "-transparent=_",
                    "content": "Marks one particular color as fully transparent.\n\ncolorspec is as described for the argument of the pnmparsecolor() library routine .\n\nTransparency works only on Palm OS 3.5 and higher.\n\n"
                },
                {
                    "name": "-scanline_compression",
                    "content": "Specifies that the output Palm bitmap will use the Palm scanline  compression  scheme.\nScanline compression works only in Palm OS 2.0 and higher.\n\n"
                },
                {
                    "name": "-rle_compression",
                    "content": "Specifies  that  the output Palm bitmap will use the Palm RLE compression scheme.  RLE\ncompression works only with Palm OS 3.5 and higher.\n\n"
                },
                {
                    "name": "-packbits_compression",
                    "content": "Specifies that the output Palm bitmap will use the Palm packbits  compression  scheme.\nPackbits compression works only with Palm OS 4.0 and higher.\n\nThis option was new in Netpbm 10.27 (March 2005).\n\n"
                },
                {
                    "name": "-density",
                    "content": "This  specifies the Palm Bitmap density.  The density is a number that is proportional\nto the resolution the image should have when displayed.  The proportionality factor is\nup to whatever is doing the displaying, but it's helpful to think of these numbers  as\nbeing pixels per inch.  The allowable values are:\n\n\n\n•      72\n\n•      108\n\n•      144\n\n•      216\n\n•      288\n\n\nThis  option  was new in Netpbm 10.27 (March 2005).  Earlier Netpbm could not generate\nVersion 3 Palm Bitmaps, so there was no such thing as density.\n\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "palmtopnm(1), pdbimgtopam(1), pnmquant(1), pnmremap(1), pnm(1)\n\n",
            "subsections": []
        },
        "NOTES": {
            "content": "Palm Bitmaps may contains multiple renditions of the same bitmap, in  different  depths.   To\nconstruct  an  N-multiple-rendition  Palm Bitmap with pnmtopalm, first construct renditions 1\nthrough N-1 using the -offset option, then construct the Nth image without  the  -offset  op‐\ntion.  Then concatenate the individual renditions together in a single file using cat.\n\nIf you will include both high density and low density renditions, put the high density images\nlast and when you create the last of the low density images, use the -withdummy option.\n\nIf  you  specify  the Palm packbits compression scheme for a 16-bit direct color bitmap, this\nprogram generates an invalid bitmap.\n\n\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "This program was originally written as ppmtoTbmp.c, by Ian Goldberg and George  Caswell.   It\nwas  completely  re-written by Bill Janssen to add color, compression, and transparency func‐\ntion.  Copyright 1995-2001 by Ian Goldberg, George Caswell, and Bill Janssen.\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/pnmtopalm.html\n\nnetpbm documentation                       25 August 2017                   Pnmtopalm User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pnmtopalm - convert a PNM image to a Palm Bitmap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Display the format of the output file."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Produce a file of depth N, where N must be either 1, 2, 4, 8, or 16. Because the de‐ fault Palm 8-bit colormap is not grayscale, if the input is a grayscale or monochrome image, the output will never be more than 4 bits deep, regardless of the specified depth. Note that 8-bit color works only in PalmOS 3.5 (and higher), and 16-bit direct color works only in PalmOS 4.0 (and higher). However, the 16-bit direct color format is also compatible with the various PalmOS 3.x versions used in the Handspring Visor, so these images may also work in that device."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Produce a file of minimal depth, but in any case less than N bits wide. If you spec‐ ify 16-bit, the output will always be 16-bit direct color."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the nextDepthOffset field in the palm file header to indicate the end of the file (and pad the end of the file to 4 bytes, since nextDepthOffset can point only to 4 byte boundaries). A palm image file can contain multiple renditions of the same image, with different color depths, so a viewer can choose one appropriate for the display. The nextDepthOffset field tells where in the stream the next rendition begins. pnmtopalm creates a file that contains only one image, but you can separately concate‐ nate multiple one-image files to create a multi-image file. If you do that, you'll need to use -offset so that the resulting concatenation is a correct stream. By default (if you don't specify -offset), pnmtopalm generates a nextDepthOffset field that says there is no following image (and does not add any padding after the image). Version 3 Palm Bitmaps actually have a nextBitmapOffset field instead of the nextDepthOffset. The foregoing applies to whichever is relevant. The -offset option was new in Netpbm 10.26 (January 2005). Before that, pnmtopalm al‐ ways set the nextDepthOffset field to \"none.\" Before Netpbm 10.27 (March 2005), you cannot use -offset if you create a compressed raster (because pnmtopalm isn't smart enough to be able to know the size of the image at the time it writes the header). You also cannot use it with 16 bit color depth or with the -colormap option, for much the same reason."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option tells pnmtopalm to put in the stream, after the image, a dummy image header to introduce subsequent high density images. This dummy image header is a special sequence specified in Palm Bitmap specifications. It looks to an older Palm Bitmap interpreter like an invalid image header, so such an interpreter will stop reading the stream there. But a new Palm Bitmap interpreter recognizes it for what it is (just something to choke an old interpreter) and skips over it. Presumably, you will add to the stream after this high density images which would confuse an older interpreter. If you specify -withdummy, you must also specify -offset, since it doesn't make any sense otherwise. -withdummy was new in Netpbm 10.27 (March 2005)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Build a custom colormap and include it in the output file. This is not recommended by Palm, for efficiency reasons. Otherwise, pnmtopalm uses the default Palm colormap for color output."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Marks one particular color as fully transparent. colorspec is as described for the argument of the pnmparsecolor() library routine . Transparency works only on Palm OS 3.5 and higher."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies that the output Palm bitmap will use the Palm scanline compression scheme. Scanline compression works only in Palm OS 2.0 and higher."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies that the output Palm bitmap will use the Palm RLE compression scheme. RLE compression works only with Palm OS 3.5 and higher."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies that the output Palm bitmap will use the Palm packbits compression scheme. Packbits compression works only with Palm OS 4.0 and higher. This option was new in Netpbm 10.27 (March 2005)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This specifies the Palm Bitmap density. The density is a number that is proportional to the resolution the image should have when displayed. The proportionality factor is up to whatever is doing the displaying, but it's helpful to think of these numbers as being pixels per inch. The allowable values are: • 72 • 108 • 144 • 216 • 288 This option was new in Netpbm 10.27 (March 2005). Earlier Netpbm could not generate Version 3 Palm Bitmaps, so there was no such thing as density."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "palmtopnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/palmtopnm/1/json"
        },
        {
            "name": "pdbimgtopam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pdbimgtopam/1/json"
        },
        {
            "name": "pnmquant",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmquant/1/json"
        },
        {
            "name": "pnmremap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmremap/1/json"
        },
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Convert a PNM image to a Palm bitmap.",
        "examples": [
            {
                "description": "Convert a PNM image to a Palm bitmap",
                "command": "pnmtopalm {{path/to/file.pnm}} > {{path/to/file.palm}}"
            },
            {
                "description": "Specify the color depth of the resulting bitmap",
                "command": "pnmtopalm {{-dep|-depth}} {{1|2|4|8|16}} {{path/to/file.pnm}} > {{path/to/file.palm}}"
            },
            {
                "description": "Choose a compression method for the resulting bitmap",
                "command": "pnmtopalm -{{scanline_compression|rle_compression|packbits_compression}} {{path/to/file.pnm}} > {{path/to/file.palm}}"
            },
            {
                "description": "Build a custom colormap and include it in the resulting bitmap",
                "command": "pnmtopalm {{-c|-colormap}} {{path/to/file.pnm}} > {{path/to/file.palm}}"
            },
            {
                "description": "Specify the bitmap's density",
                "command": "pnmtopalm {{-den|-density}} {{72|108|144|216|288}} {{path/to/file.pnm}} > {{path/to/file.palm}}"
            }
        ]
    }
}