I've been using these for as long as I can remember.
For snapshots of a specific window:
#!/bin/bash
picdir='/home/tron/pictures/snapshots'
i=$(ls -1 ${picdir} | grep -o '[0-9]*' | sort -n | tail -n 1)
xwd | convert - ${picdir}/snapshot$(($i+1)).png
convert -thumbnail 100x100 ${picdir}/snapshot$(($i+1)).png \
${picdir}/thumbs/snapshot$(($i+1)).thumb.png
For snapshots of the whole screen (everything that X is currently drawing):
#!/bin/bash
picdir='/home/tron/pictures/snapshots'
i=$(ls -1 ${picdir} | grep -o '[0-9]*' | sort -n | tail -n 1)
xwd -root | convert - ${picdir}/snapshot$(($i+1)).png
convert -thumbnail 100x100 ${picdir}/snapshot$(($i+1)).png \
${picdir}/thumbs/snapshot$(($i+1)).thumb.png
I have them bound to Ctrl+PrtScn and PrtScn, respectively. If you want to also automagically upload the file to a server and put its url into the clipboard (the middle click buffer), stick this at the end of the file:
ftp -n -i <<END
open ftp.example.org
user username password
cd blah/blah/blah
put ${picdir}/snapshot$(($i+1)).png snapshot$(($i+1)).png
close
bye
END
xsel -c
echo "http://example.org/blah/blah/blah$(($i+1)).png" | xsel -b