imagecapture([<window name>, [<output file>,(opt)<width-x>,(opt)<height-y>,(opt)x,(opt)y]])
Capture snap-shot of the window. Where startx & starty are offset. If window name is not provided, then the complete X screen is captured. If output file name is not provided, then a temporary file will be created and the file name will be returned. File has to be explicitly deleted by the user.
from ldtputils import *
imagecapture('Terminal', 'out.png') # out.jpg will be created in current directory. Give absolute path to save it in some other directory.
imagecapture() # Captures the complete X screen and saves in a temp file and returns the file name.
Import utility of ImageMagick - http://www.imagemagick.org/script/import.php # Mandatory dependency, if you want to use this function.