I was trying to capture a single window using ximagesrc. Encoding it to png and saving it gives black bordes around the image. This was the command i used.
ximagesrc