pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, sz[0], sz[1])
pb = pb.get_from_drawable(w, w.get_colormap(), 0, 0, 0, 0, sz[0], sz[1])
pixel_array = pb.get_pixels_array()
return pixel_array[y][x]
print(PixelAt(int(sys.argv[1]), int(sys.argv[2])))
How can I grab the color of a pixel on my desktop? (Linux)