I have a task - to display text on the image. I first tried with Pillow, but I did not like it. It has a very bad and inconvenient API and cannot kindly output multi-line text. So here I am trying to do Qt now:
img = QImage('input.jpg') painter = QPainter(img) painter.setPen(QPen(Qt.red)) painter.setFont(QFont('Arial', 12, QFont.Bold)) painter.drawText(img.rect(), Qt.AlignCenter, 'Hello world!') painter.end() img.save('output.jpg') But when it comes to painter.drawText error Windows crashes. "Python program terminated." In detail, the Qt5Gui.dll module is Qt5Gui.dll . What does it mean?

QPaintDeviceobject. I suppose this is an alternative to calling the begin method. Although tried and cause - the same effect. - PECHAPTERQGuiApplicationinstance inQGuiApplication. A segmentation error occurs in theQGuiApplication::font()function. - mkkik