XPMTOPPM(1)

✨ XPMTOPPM ✨

okay bestie, welcome to the Xpmtoppm User Manual, section 1 of the General Commands Manual πŸ’– she's a little old-school, she's a little chaotic, but she gets the job done.


πŸŽ€ NAME πŸŽ€

xpmtoppm β€” convert an X11 pixmap to a PPM image. literally her whole thing. no notes. πŸ’…


🌸 SYNOPSIS 🌸

xpmtoppm

[--alphaout={alpha-filename,-}] [-verbose]

[xpmfile]

yes, she really does look like that. yes, the flags are optional. yes, you're gonna be fine. 🫢


πŸ’œ DESCRIPTION πŸ’œ

so this program is part of Netpbm(1), which is the iconique little family she belongs to πŸ‘‘

xpbtoppm reads an X11 pixmap (XPM version 1 or 3) as input and produces a PPM image as output. that's it. that's the vibe. reads pixmap, writes PPM, no cap. ✨


πŸ¦‹ OPTIONS πŸ¦‹

besides the options that are common to all programs based on libnetpbm (and the most famous one is -quiet, peep the Common Options section for that), xpmtoppm recognizes these command line options, and honestly? she's serving:

  • --alphaout=alpha-filename β€” this one makes xpmtoppm create a PBM file holding the transparency mask for the image. if your input image has no transparency info in it, then the alpha-filename file just contains all white (opaque) transparency values. cute, right? 🀍

if you don't specify --alphaout, then xpmtoppm does not generate a transparency file at all, and it straight up discards any transparency information the input image contains. gone. deleted. not even in the drafts. πŸ’€

if you specify - as the filename, xpmtoppm writes the transparency output to Standard Output and discards the image. (the image!! discarded!! she said one or the other, bestie πŸ™ˆ)

go look at pamcomp(1) for one way to actually use that transparency output file. that's the move. πŸ‘‘

heads up: xpmtoppm can't handle a line longer than 8K characters in the XPM input. if an input line goes over that limit, xpmtoppm quits with an error message to that effect. before Netpbm 10.30 (October 2005), the limit was 2K. so like, glow-up era. ✨
  • --verbose β€” xpmtoppm prints information about its processing on Standard Error. she's a talker. she's telling you everything. πŸ—£οΈπŸ’…

😭 LIMITATIONS 😭

okay so, real talk time. xpmtoppm recognizes only a limited set of the features of XPM Version 3; i.e. it rejects many valid XPM images as invalid. not her fault, it's just her range. πŸ™ˆ

the only place a comment block is valid is starting in Column 1 of the line immediately after "static char ...". that's the one spot. that is the spot. 🎯

in addition, ppmtoxpm properly recognizes any single-line comment that begins in Column 1 in the color table part of the file.

there must be for every pixel a default colorname for a color type visual. every single pixel. no exceptions, no skipping, periodt.

before Netpbm 10.58 (March 2012), zero bytes per pixel causes the program to fail with a message about premature EOF on input. so if you're on ancient Netpbm, that's a you problem, iykyk πŸ’€

πŸ’– SEE ALSO πŸ’–

ppmtoxpm(1), pamcomp(1), ppm(1) β€” the whole friend group, the whole squad, go say hi 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Copyright (C) 1991 by Jef Poskanzer. πŸ’œ

Upgraded to work with XPM version 3 by Arnaud Le Hors <lehors@mirsa.inria.fr>, Tue Apr 9 1991. πŸŽ€


🌟 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/xpmtoppm.html

aaaand that's the page fr fr 🫢 this was the netpbm documentation drop from 31 December 2011, Xpmtoppm User Manual(1) β€” iconic, timeless, slay πŸ’…βœ¨πŸŒΈπŸ’–

πŸ“¦ where this page comes from