fbgrab(1)

fbgrab1

Takes screenshots using the framebuffer device

Usage

fbgrab [options] filename

Overview

fbgrab reads the framebuffer device (/dev/fb*) or a dump thereof and saves a PNG image file. You can use it for making screenshots of of virtually any application, from traditional test applications to your X-windows desktop, as well as framebuffer applications.

Options

-?

print usage information.

-a

ignore the alpha channel with drivers incorrectly setting but not supporting an alpha channel.

-b bitdepth

the number of bits per pixel used, optional when reading from device.

-c console

specifies which console (or virtual terminal - like other people call this feature) to grab. Sometimes this changing is faster then the framebuffer is refreshed (especially when grabbing framebuffer apps). If so, you should use -C console ... This waits some time before grabbing. You can't use -s in this case.

-d device

specifies which framebuffer device you want to read. If you do not use this option, it takes the value from the FRAMEBUFFER environment variable. If no FRAMEBUFFER environment variable is given or if its value is NULL, then DEFAULT_FB is taken. (see source code), which usually is /dev/fb0.

-f filename

Read from from file instead of device, requires that -w (width), -h (height) and -b (bitdepth) are specified.

-h height

the height of the framebuffer in pixels, optional when reading from device.

-i interlacing

turns off interlacing. If you do not want ADAM7 interlacing, you should use the -i option.

-l line length, a.k.a. stride.

the length in pixels between the start of each row in the framebuffer, which might be larger or equal to width. Optional when reading from device.

-s seconds

specifies how many seconds to wait before grabbing. fbshot does not lock console switching, so you can switch it while waiting, if you cannot use -c requires normally that fbgrab is run as root.

-v verbose

be verbose

-w width

the width of the frambeuffer in pixels, optional when reading from device.

-z compression level

set png compression level 0 (fast) to 9 (best).

Todo

* Low-end bit depths, eg 1, 2, 4 & 8 bits.

* Companion program fbput that would display a picture in the frambuffer.
* Better utilization of the PNG-lib, all formats are first converted to 32 bitdepth and then stored as PNG - hardly the right approach.

Examples

fbgrab fb.png

will take a framebuffer snapshot, or if you don't have fbgrab at your machine, you can do

cp /dev/fb0 framebuffer.dump

and then

fbgrab -w 1024 -h 768 -l 2048 -b 16 -f framebuffer.dump fb.png

to convert it to a picture.

Releases

12 releases since Debian 3.1 (Sarge); the text changed 7 times.

  1. 3.1
  2. 4.0–5.0
  3. 6.0
  4. 7–8
  5. 9–10
  6. 11
  7. 12–13
  8. Arch

-a since Arch Linux 2026-11-01; -v since Arch Linux 2026-11-01.

-C until Debian 13 (Trixie).

Author

Written by Gunnar Monell <[email protected]>. Basically a rewrite of fbshot by Stephan Beyer <[email protected]>

From fbgrab 1.5-3 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.