def toBitmap(self): size = QSize(self.width, self.height) return QBitmap.fromData(size, self.data, QImage.Format_Mono)