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

Seaborn - Why import as sns?
Renaming the Columns in Self-Join of data frame in Spark
How to upload image using ckeditor in django?
Implementing Django style API, chaining dots, inheritance
Python ~ Getting first few numbers from left to right
Error installing twisted on windows 10. INCLUDE environment variable is empty
How to implement “circular” generator in Python?
telegram bot. Forward message to another chat
Pyspark aggregation using groupBy is very slow compared to Scala
Multiple delimiters in single CSV file
Is it safe to use scipy.sparse functions with Pandas sparse dataframes?
I got error : UnboundLocalError: local variable 'porc' referenced before assignment
Trigger a delete when inserting a new entry on django
How does gauss laguerre integration works for large limits?
Selenium: Runtime.executionContextCreated has invalid 'context':
Python 3.5 csv input shows extra character 'b'

Categories

HOME
app-inventor
rotation
d
bro
sequelize.js
facebook-javascript-sdk
ipfs
postmessage
sonarqube-msbuild-runner
statusbar
rails-activerecord
epicor
extractor
scalajs-react
guile
frp
ggmap
multichoiceitems
aurelia-binding
hibernate-cache
percentage
spreedly
pljson
mapguide
remote-server
nunit-3.0
ksoap
swagger-editor
dql
sql-like
declare
installshield-2012
productivity
crop
automator
rdw
gd
jags
broadcast
ogre3d
settimeout
iostat
galleriffic
dts
spark-cassandra-connector
instruments
nssplitview
ng2-material
axes
asp.net-mvc-2
android-cursoradapter
datasnap
fabric-twitter
connection-reset
rx-groovy
viewflipper
odftoolkit
dto
alertifyjs
help-viewer
resource-files
crystal-reports-10
sanitization
sim900
gamepad
document-database
dllexport
iconv
reporting-tools
device-emulation
crocodoc
cadisplaylink
datarepeater
expression-evaluation
concurrent-programming
viewdidload
ubuntu-11.04
text-size
tcxgrid
datacontract
paintcomponent
cookieless
audiostreamer
symbol-server
msn
querypath
unreachable-code
gwt-2.2-celltable
openwysiwyg

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