Python: implement ImageBuf.get_pixels()