numpy effiency way to multiple transformation array
In Linux, I take screenshots and draw squares at certain coordinates. My code works fine, but I transform the numpy array several times. def get_screenshot(self): # Take screenshot pixmap = window.get_image(0, 0, width, height, X.ZPixmap, 0xffffffff) # type(data) = <class ‘bytes’> data = pixmap.data # type(data) = <class ‘bytearray’> data = bytearray(data) self.screenshot = np.frombuffer(data, … Read more