PPMTOSIXEL(1)
π PPMTOSIXEL π
okay bestie, welcome to the Ppmtosixel User Manual, section 1 of the General Commands Manual π this one's a little retro, a little niche, and honestly kinda iconic β we're turning PPMs into DEC sixel. periodt.
β¨ NAME β¨
ppmtosixel β convert a PPM image to DEC sixel format πΈ
π¦ SYNOPSIS π¦
ppmtosixel
[-raw]
[-margin]
[-7bit]
[ppmfile]
π DESCRIPTION π
so this program is part of Netpbm(1), obvi. π
ppmtosixel reads a PPM image as input and produces sixel commands (SIX) as output. the output is formatted for color printing (like, for a DEC LJ250 color inkjet printer, hello) or for color display on DEC VT terminals and terminal emulators (VT240 and beyond, the way that's a whole era π).
if the RGB values from the PPM file do not have maxval=100, ppmtosixel rescales them to maxval 100. a printer control header and a color assignment table kick off the SIX file. image data is in a compressed format by default. and a printer control footer ends the image file. cute little sandwich π₯ͺβ¨
π OPTIONS π
on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), ppmtosixel recognizes the following command line options:
-rawβ if you specify this, every single pixel gets explicitly described in the image file. no shortcuts, no compression, just vibes. if-rawis not specified, output defaults to compressed format, where identical adjacent pixels get replaced by "repeat pixel" commands. heads up bestie: a raw file is often an order of magnitude larger than a compressed file, and it prints much slower π-marginβ if you don't specify-margin, the image starts at the left margin (of the window, paper, or whatever). if you do specify-margin, a 1.5 inch left margin will offset the image. giving it some personal space π-7bitβ if you don't specify-7bit, each control code is expressed as a single, 8-bit "C1" character. if you do specify-7bit, each control code is expressed using two, 7-bit "C0" characters. (see C0 and C1 control codes for more info.) in other words:-7bitproduces more portable sixel files, and its absence produces smaller sixel files. pick your fighter π«Ά
this option was new in Netpbm 11.04 (September 2023). fresh off the press β
π¨οΈ PRINTING π¨οΈ
generally, sixel files must reach the printer unfiltered. use the lpr -x option, or:
cat filename > /dev/tty0?
no cap, that's the whole move.
π LIMITATIONS π
okay so real talk, there are some caveats and we're not gonna pretend otherwise:
- upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. π
- if the original PPM
maxvalwas greater than 100, rescaling also reduces the image depth. - while the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. this seems to be a printer limitation β not our fault, not your fault, just printer behavior π
π SEE ALSO π
ppm(1)
π AUTHOR π
Copyright (C) 1991 by Rick Vinci.
π DOCUMENT SOURCE π
this manual page was generated by the Netpbm tool makeman from HTML source. the master documentation is at
http://netpbm.sourceforge.net/doc/ppmtosixel.html
and that's the whole page bestie π huge shoutout to the netpbm documentation, dated 1 August 2023, living under the title Ppmtosixel User Manual(1) β go forth and sixel responsibly, ily πβ¨π¦
π¦ where this page comes from
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms