Document Actions

Screenshots in Linux

by David Hostetler [modified 20090206:01:52 (Fri)] [posted 20081128:13:04 (Fri)]

There are a lot of ways to capture image buffers in an X-Org based environment, but I found one that I preferred, and it's ImageMagick's 'import' utility.  Very flexible, and more importantly, well documented and maintained.  Out of the box, it does time-lapse multi capture, which is generally what I'm after when I'm playing games (which I'm doing more and more of on Linux and not on Win32) and I want to have a framegrabber running in the background taking periodic grabs.  A line like the following will get the job done adequately:

import -depth 32 -pause 10 -quality 100 -silent -snaps 5 -window root foobar.png

I'm probably going to cook up a little python script that leverages import, rather than relying on just the command line, since it will provide greater control and flexibility for a session-based use of the tool, and because it looked like import keeps all the grabs in memory until it's done, which isn't suitable for accumulating a lot of images in one session.

This worked a lot better than other attempts with things like scrot, fbgrab, etc..  xv is good for one-off manual grabs, but doesn't provide any automated time-lapse feature, which is what sent me googling in the first place.