RAWTOPPM(1)

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

πŸ’– rawtoppm β€” the manual, but make it slay πŸ’–

okay bestie, welcome to Rawtoppm User Manual, from the General Commands Manual section πŸŽ€ this is a Netpbm girlie and she's here to turn your raw RGB bytes into a whole entire PPM image. no cap.


✨ NAME ✨

rawtoppm β€” convert a stream of raw RGB bytes to a PPM image πŸ¦‹


🌸 SYNOPSIS 🌸

rawtoppm

[-headerskip N]

[-rowskip N]

[ -rgb|-rbg|-grb |-gbr|-brg|-bgr ]

[-interpixel|-interrow] width height

[imagedata]

πŸ‘‘ DESCRIPTION πŸ‘‘

so this program is part of Netpbm(1), bestie, keep up πŸ’…

rawtoppm reads raw RGB bytes as input and produces a PPM image as output. the input file is literally just RGB bytes. nothing else. no lil header, no metadata, no vibe check β€” just bytes.

that's why you have to specify the width and height on the command line, because the program obviously can't get them from the file. it's not psychic, it's a converter 😭

rawtoppm assumes the maxval of the input samples is 255, and it makes the maxval of the output PPM 255 too. consistent queen behavior ✨

⚠️ big heads up: rawtoppm assumes the pixels come top first in the input stream. if they are actually bottom first, the resulting PPM is upside down πŸ™ƒ β€” so run it through pamflip -tb to fix that. iykyk.

πŸ’… OPTIONS πŸ’…

on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), rawtoppm recognizes the following command line options:

  • -headerskip β€” skip over this many bytes at the beginning of the input stream. use this when your input has some kind of header followed by a raster that's suitable for rawtoppm. basically: yeet the header, keep the pixels 🫢
  • -rowskip β€” skip this many bytes at the end of each row of the raster. some input streams have padding at the end of rows, and this is how you politely ignore it πŸ’–
  • -rgb, -rbg, -grb, -gbr, -brg, -bgr β€” this option specifies the order of the color components for each pixel. the default is -rgb 🌈
  • -interpixel, -interrow β€” these options specify how the colors are interleaved. the default is -interpixel, meaning interleaved by pixel β€” a byte of red, a byte of green, and a byte of blue, or whatever color order you specified. -interrow means interleaved by row: a row of red, a row of green, a row of blue, assuming standard rgb color order πŸŽ€
πŸ’€ ngl, an -interplane option β€” all the red pixels, then all the green, then all the blue β€” would be an obvious extension, but it is not implemented. F in the chat. you could get the same effect by splitting the file into three parts (perhaps using dd), turning each part into a PGM file with rawtopgm, and then combining them with rgb3toppm. girlboss workaround, honestly πŸ‘‘

πŸ”₯ SEE ALSO πŸ”₯

ppm(1), rawtopgm(1), rgb3toppm(1), pamflip(1)


🌈 AUTHOR 🌈

Copyright (C) 1991 by Jef Poskanzer. iconic, we stan πŸ’œ


πŸ“– 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/rawtoppm.html

aaaand that's the whole thing bestie πŸ’– from netpbm documentation, dated 06 February 1991, and the title is Rawtoppm User Manual(1) β€” periodt. go convert some bytes and slay πŸŒΈβœ¨πŸ¦‹

πŸ“¦ where this page comes from