I have a QGraphicsView with a QGraphicsScene scene
and I add a pixmap to this scene. This works fine:
image = QtGui.QImage(1, 1, QtGui.QImage.Format_Indexed8)
image.load(fileName)
image = image.convertToFormat(6)
"""
# make white pixels transparent
transparency = QtGui.QColor(255, 255, 255, 255)
transparencyValue = transparency.value()
for x in range(image.width()):
for y in range(image.height()):
color = QtGui.QColor(image.pixel(x, y))
if color.red() == 255 and color.green() == 255 and color.blue() == 255:
image.setPixel(x, y, transparencyValue)
"""
pixmap = QtGui.QPixmap.fromImage(image)
pixmapItem = myScene.addPixmap(pixmap)
However, when I add transparency to the pixmap (the multiline comment in the code), it gets blue striped borders left and right, as well as all additional single QGraphicsPixmapItems on the scene do. How can I get rid of the borders?