python


Transparent pixmap: blue borders as drawing artefacts


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?

Related Links

python filter files by modified time
Python, Multiprocessing: what to do if process.join() waits forever?
How to sum values in an iterator in a PySpark groupByKey()
Allauth will not save additional fields
Read Flask Session Cookie
How do I make my script take only numeric inputs without screwing it up
Incorrect output while reading text file in Python
PhantomJS - Permission Denied
Combining image RGB channels
Python input validation and edge case handling
Struggling with making a Python module accessible via PyPi
Finding the minimum and maximum of a list of arrays
Accessing Google Drive Spreadsheets with Python Gspread
py.test & pytest on Raspberry Pi : Differences ?
Find maximum of column for each business quarter pandas
placeholder functions in sympy

Categories

HOME
python
cluster-computing
answer-set-programming
wms
matplotlib
search-engine
value
filter
simpy
contact-form-7
pca
lotus-notes
powershell-v3.0
flexbox
x-frame-options
dendrogram
quartus
jcl
vs2017
pycrypto
fop
avplayeritem
binutils
logarithm
tfs2013
philips-hue
iis-10
pipelinedb
branch
guile
ggmap
websauna
referenceerror
geopy
powershell-remoting
css-counter
oscommerce
active-model-serializers
tripwire
xbim
openweathermap
ajp
jtds
persistent
etherpad
cdk
lotus
c64
update-site
freetype2
amf
django-south
mpeg-4
flexjson
optionbutton
futuretask
qbfc
urn
playscape
castle-windsor-3
utf-32
aquafold
cppdepend
lumx
gfs
baucis
vmware-server
argb
surveyor-gem
mailcore
fraud-prevention
awesomeprint
trailing-slash
lync-server-2010
scrollto
mpmovieplayer
ou
qtembedded
goliath
search-path
nagle
.app
gwt-2.2-celltable
aio
rtsp-client
dotproject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App