(example of using it to transfer screenshot over SSH)
xwd(1) will also do it
Other methods: scrot, imlib2_grab, ksnapshot