Howto take a screenshot with Imagemagick

Taking a screenshot is something that might be considered essential in various occasions. Of course there are great programs available with gui, like gnome-screenshot, but sometimes you might want to add a little bit more control to what gets in the screenshot and when the screenshot is taken.

Some years ago I came across to a little handy program called Imagemagick which I nowadays use in my desktops exclusively to make screenshots to illustrate things to other people. One of the top factors in imagemagick is that you can actually select the area with mouse you want to include to the screenshot. Another handy feature is that you can delay the taking of the screenshots in order to get all private stuff out of the way.

Before we start it is always a good thing to make sure that imagemagick is actually installed.
So open synaptic or some other graphical package manager and search for imagemagick and install it.

You can alternatively do things in terminal as a root user:

In Debian (and others which might use root account):
su root
apt-get install imagemagick

In Fedora:
su root
yum install imagemagick

In Ubuntu/Linux Mint
sudo apt-get install imagemagick

So how can we take the screenshot with Imagemagick? Solution is simple. If you are using Fluxbox and are a finn like me you could just add the following to your .fluxbox/menu file:

[exec] ( Kokonainen kuvankaappaus 10 sekunnin viiveellä ) {sleep 10; import -window root kuvankaappaus.png}
[exec] ( Kuvankaappaus valinta-alueelta ) {import kuvankaappaus2.png}

However a sort explanation is in order since most people might not be comfortable in using Finnish language. So here are the English variants of the above commands:

[exec] ( Capture whole screen with 10 second delay ) {sleep 10; import -window root screen.png}
[exec] ( Capture screen from the selected area ) {import screen2.png}

Do note the following: the actual commands to make things happening with imagemagick are:

sleep 10; import -window root screen.png

AND

import screen2.png

You can of course adjust and tweak these commands to your liking and for example add some more sleep time to the first command instead of 10 seconds or decrease it. The previous applies to the second command as well. To the end of this post I would like to mention that if you do not use Fluxbox you can always start your terminal client (gnome-terminal, lxterminal, guake, or some other) and “throw” the Imagemagick commands ,presented in this post, to them to achieve the wanted results.