def __screencap(self, display_id: int = None) -> Image.Image:
        """ Take a screenshot and return PIL.Image.Image object
        """
        # framebuffer() is not stable, so here still use screencap
        cmdargs = ['screencap', '-p']
        if display_id is not None:
            _id = self.__get_real_display_id(display_id)
            cmdargs.extend(['-d', _id])
        png_bytes = self.shell(cmdargs, encoding=None)
        return Image.open(io.BytesIO(png_bytes))
 Take a screenshot and return PIL.Image.Image object
        
adbutils/screenshot.py