{
    "mode": "man",
    "parameter": "ppmtosixel",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ppmtosixel/1/json",
    "generated": "2026-06-13T22:08:03Z",
    "synopsis": "ppmtosixel [-raw] [-margin] [ppmfile]",
    "sections": {
        "NAME": {
            "content": "ppmtosixel - convert a portable pixmap into DEC sixel format\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ppmtosixel [-raw] [-margin] [ppmfile]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  portable  pixmap as input.  Produces sixel commands (SIX) as output.  The output is\nformatted for color printing, e.g. for a DEC LJ250 color inkjet printer.\n\nIf RGB values from the PPM file do not have maxval=100,  the  RGB  values  are  rescaled.   A\nprinter  control header and a color assignment table begin the SIX file.  Image data is writ‐\nten in a compressed format by default.  A printer control footer ends the image file.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-raw -raw",
                    "content": "not  specified,  output  will default to compressed format in which identical adjacent\npixels are replaced by \"repeat pixel\" commands.  A raw file is often an order of  mag‐\nnitude larger than a compressed file and prints much slower.\n"
                },
                {
                    "name": "-margin",
                    "content": "If  -margin  is not specified, the image will be start at the left margin (of the win‐\ndow, paper, or whatever).  If -margin is specified, a 1.5 inch left margin will offset\nthe image.\n"
                }
            ]
        },
        "PRINTING": {
            "content": "Generally, sixel files must reach the printer unfiltered.  Use the lpr -x option or cat file‐\nname > /dev/tty0?.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Upon rescaling, truncation of the least significant bits of RGB values  may  result  in  poor\ncolor  conversion.   If  the original PPM maxval was greater than 100, rescaling also reduces\nthe image depth.  While the actual RGB values from the ppm file are more  or  less  retained,\nthe  color  palette of the LJ250 may not match the colors on your screen.  This seems to be a\nprinter limitation.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ppm(5)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (C) 1991 by Rick Vinci.\n\n\n\n26 April 1991                              ppmtosixel(1)",
            "subsections": []
        }
    },
    "summary": "ppmtosixel - convert a portable pixmap into DEC sixel format",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "not specified, output will default to compressed format in which identical adjacent pixels are replaced by \"repeat pixel\" commands. A raw file is often an order of mag‐ nitude larger than a compressed file and prints much slower."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If -margin is not specified, the image will be start at the left margin (of the win‐ dow, paper, or whatever). If -margin is specified, a 1.5 inch left margin will offset the image."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ppm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/ppm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Convert a PPM image to DEC sixel format.",
        "examples": [
            {
                "description": "Convert a PPM image to DEC sixel format",
                "command": "ppmtosixel {{path/to/file.ppm}} > {{path/to/file.sixel}}"
            },
            {
                "description": "Produce an uncompressed SIXEL file that is much slower to print",
                "command": "ppmtosixel {{-r|-raw}} {{path/to/file.ppm}} > {{path/to/file.sixel}}"
            },
            {
                "description": "Add a left margin of 1.5 inches",
                "command": "ppmtosixel {{-m|-margin}} {{path/to/file.ppm}} > {{path/to/file.sixel}}"
            },
            {
                "description": "Encode control codes in a more portable (although less space-efficient) way",
                "command": "ppmtosixel -7bit {{path/to/file.ppm}} > {{path/to/file.sixel}}"
            }
        ]
    }
}