FB-PNG(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’Ύ fb-png β€” the NAME bit πŸ’…

okay so bestie, fb-png saves a framebuffer image as a Portable Network Graphics (PNG) file. that's the whole vibe. ✨


🌸 SYNOPSIS 🌸

fb-png [-i] [-c] [-# nbytes/pixel] [-F framebuffer] [-g gamma] [-s squaresize] [-w width] [-n height] [file.png]

πŸŽ€ DESCRIPTION πŸŽ€

so fb-png literally reads a region of a framebuffer and saves it as a PNG (Portable Network Graphics) file. that's it, that's the girlboss move. πŸ’– if you don't hand it an output file name, the data goes straight to standard output. no drama.

by default the region it reads is 512x512 pixels, in first-quadrant order (origin at the lower left, iykyk). wanna change the size? that's what -s, -w, and -n are for, bestie. and if the open framebuffer is smaller than the size you asked for? no worries β€” the region gets trimmed to fit. 🫢

cute lil note: use png-fb(1) to display a PNG file in a framebuffer. the reverse slay.

✨ OPTIONS ✨

  • -i β€” reads the framebuffer bottom-to-top, inverting the image vertically (fourth-quadrant order, origin at the upper left). flip it, reverse it, iconic. πŸ”„
  • -c β€” applies ("crunches") the framebuffer color map to pixel values before writing. if the framebuffer has no map, or has a linear one, this one just gets ignored. πŸ™ˆ
  • -# nbytes/pixel β€” number of bytes per pixel: 1 for grayscale or 3 for color (color is the default, obvi πŸ’…).
  • -F framebuffer β€” specify the framebuffer device. defaults to the FB_FILE environment variable (peep brlcad(1) for the tea β˜•).
  • -g gamma β€” writes the specified gamma correction value into the PNG gAMA chunk. a value of 0.6 approximates PC display monitors. a non-positive value (the default is -1.0) disables writing the gAMA chunk entirely. so like, -1.0 = no gAMA chunk, at all, periodt.
  • -s squaresize β€” sets both width and height to squaresize pixels (default 512). symmetrical queen. πŸ‘‘
  • -w width β€” sets the width in pixels (default 512).
  • -n height β€” sets the height in pixels (default 512).
  • -h, -? β€” prints a usage message and exits. the classic "help me help you" moment 😭

πŸ”₯ EXAMPLES πŸ”₯

Example 1. Render a model and capture the framebuffer to PNG

rt -s 1024 -F /dev/X moss.g all.g &
fb-png -F /dev/X -s 1024 moss.png

ray traces the moss.g model into a 1024x1024 X11 framebuffer with rt(1), then grabs that framebuffer and saves it as a PNG image of the exact same size. matching the -s size to the framebuffer is the whole trick β€” it ensures the entire image gets captured. no crumbs left behind. πŸ“

Example 2. Save the lower-left quadrant of the default framebuffer

fb-png -w 256 -n 256 crop.png

reads only a 256x256 region (anchored at the origin) from the framebuffer named by the FB_FILE environment variable, and writes it to crop.png. tiny, precious, a lil snack. 🧚


πŸ¦‹ SEE ALSO πŸ¦‹

brlcad(1), png-fb(1), fb-bw(1), pix(5)


πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” legends, honestly.


This software is Copyright (c) 1998-2026 by the United States Government as represented by U.S. Army Research Laboratory. (yes, the whole range, 1998 all the way to 2026, fr fr.)


⭐ BUG REPORTS ⭐

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. tell 'em you sent the bugs, not the vibes πŸ’€


anyway that's the whole page bestie β€” brought to you by the BRL-CAD girlies, FB-PNG(1) energy, dated somewhere in the 1998-2026 copyright era. now go capture that framebuffer, you absolute main character. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from