Lots of folks have recommended ImageMagic and it's an excellent tool, but I've found it can be overly complex. I've found graphics/GraphicsMagick (to be a much more compact, efficient, and easier tool than ImageMagick. Per it's website about the Import function:
> Import reads an image from any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen. Use display for redisplay, printing, editing, formatting, archiving, image processing, etc. of the captured image.
> The target window can be specified by id, name, or may be selected by clicking the mouse in the desired window. If you press a button and then drag, a rectangle will form which expands and contracts as the mouse moves. To save the portion of the screen defined by the rectangle, just release the button. The keyboard bell is rung once at the beginning of the screen capture and twice when it completes.
GM started as a fork of ImageMagic since version 5.5, but has seen been completely rewritten. I've found it a better match for my particular needs.
Also, your particular DE should have a utility for screenshots (built-in or as an addon). I use Xfce and there's a seperate utility for screenshots - Xfce4-Screenshooter (/x11/xfce4-screenshooter-plugin/). Your DE may have something as well.