def qPixmapToNumpy(pixmap):
    image = pixmap.toImage()
    image = image.convertToFormat(QImage.Format.Format_RGB32)
    width = image.width()
    height = image.height()
    ptr = image.bits()
    ptr.setsize(((height * width) * 4))
    arr = np.frombuffer(ptr, np.uint8).reshape((height, width, 4))
    return arr[:, :, 0:3].copy()
def qPixmapToNumpy(pixmap):
    image = pixmap.toImage()
    image = image.convertToFormat(QImage.Format.Format_RGB32)
    width = image.width()
    height = image.height()
    ptr = image.bits()
    ptr.setsize(((height * width) * 4))
    arr = np.frombuffer(ptr, np.uint8).reshape((height, width, 4))
    return arr[:, :, 0:3].copy()