RASTTOPNM(1)

πŸ“¦
version 11.13.03 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ RASTTOPNM πŸ’… (that's the Rasttopnm User Manual, bestie, section 1 of the General Commands Manual obvs)

🌸 NAME 🌸

rasttopnm β€” the girl whose whole job is turning a Sun rasterfile into a PNM image πŸŽ€


✨ SYNOPSIS ✨

rasttopnm
    [-index]
    [rastfile]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so first things first: this program is part of Netpbm(1). Family business, iconic lineage, no cap.

rasttopnm reads a Sun rasterfile as input and produces a PNM image as output. And here's the slay β€” the type of the output file actually depends on the input file:

  • If it's black and white, rasttopnm writes a PBM image.
  • If it's grayscale, rasttopnm writes a PGM.
  • If it's color, rasttopnm writes a PPM.

And because she's a considerate queen, the program literally tells you which type it's generating. Communication skills: immaculate. 🫢


πŸ’– OPTIONS πŸ’–

So besides the options common to all programs based on libnetpbm β€” most notably -quiet, peep the Common Options section, iykyk β€” rasttopnm recognizes this one command line option:

  • -index β€” this odd little option tells rasttopnm to use the color map indices in the raster as if they are the color values. It's giving "gaslight, gatekeep, index" honestly. πŸ™ˆ

Okay let me explain the lore. In a colormapped Sun rasterfile, the header of the file contains a color map, and that map associates each unique color that occurs in the file with an index number. Then the raster portion of the file represents the color of a pixel using one of those colormap indices. Cute system, love that for them.

And this option has found use as follows, bestie, pay attention: take a regular grayscale Sun rasterfile in which all the grayscale values are represented, so the colormap indices are identical to the color values. Then modify its color map so as to alter the colors in the image β€” in particular, to equalize the colors. Now feed that modified rasterfile in as input:

  • rasttopnm without -index produces the modified image.
  • But with -index, it produces the original unmodified image.

Like... she keeps the receipts. πŸ’€βœ¨

This option was new in Netpbm 10.56 (September 2011). So yeah, it's an elder Gen Z. Respect.

πŸ‘‘ SEE ALSO πŸ‘‘

pnmtorast(1), pnm(1) β€” go say hi to the cousins, they're also iconic. 🌈


πŸŽ€ AUTHOR πŸŽ€

Copyright (C) 1989, 1991 by Jef Poskanzer. Legend behavior, fr fr. πŸ’œ


πŸ“š DOCUMENT SOURCE πŸ“š

This manual page was generated by the Netpbm tool makeman from HTML source. Yeah, she's built in a factory but she still has main character energy. The master documentation lives at:

http://netpbm.sourceforge.net/doc/rasttopnm.html

And that's the whole page, bestie!! This was the netpbm documentation, dated 16 August 2011 β€” the Rasttopnm User Manual(1), periodt. πŸ’…βœ¨ Take a raster, leave a PNM, stay hydrated, and remember: -index is not like other flags. πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from