This question is similar to this one
Fastest method of screen capturing
but for linux/X11.
To be more specific, i need a method to capture the pixel
You can use xwd(1) to dump a X11 window (and xwud(1) to display it). ImageMagick and the Netpbm tools know how to deal with the XWD format. But these are not especially fast. And they will not reveal hidden portions of a window.