When trying to display a PNG via wx.Image and wx.BitmapFromImage, it
appears as though the alpha channel isn't rendered properly. I have
attached a sample image and test-case, which is a white-to-transparent
gradient on top, and a solid white color on the bottom. That image
/should/ render as solid white when the background is white, however it
instead renders a greyish-gradient. Is this a bug in wxPython, or
wxWidgets, or am I doing something wrong?
Attached are white_gradient.png (the 32-bit gradient/white PNG), test.py
(an example), and result_output.png (a screenshot of the example as
taken on WinXP).
When trying to display a PNG via wx.Image and wx.BitmapFromImage, it
appears as though the alpha channel isn't rendered properly. I have
attached a sample image and test-case, which is a white-to-transparent
gradient on top, and a solid white color on the bottom. That image
/should/ render as solid white when the background is white, however it
instead renders a greyish-gradient. Is this a bug in wxPython, or
wxWidgets, or am I doing something wrong?
Attached are white_gradient.png (the 32-bit gradient/white PNG), test.py
(an example), and result_output.png (a screenshot of the example as
taken on WinXP).
It will probably ring like one of those annoyingly-spot-on commercials, but your test case renders perfectly on Mac.
When trying to display a PNG via wx.Image and wx.BitmapFromImage, it
appears as though the alpha channel isn't rendered properly. I have
attached a sample image and test-case, which is a white-to-transparent
gradient on top, and a solid white color on the bottom. That image
/should/ render as solid white when the background is white, however it
instead renders a greyish-gradient. Is this a bug in wxPython, or
wxWidgets, or am I doing something wrong?
Attached are white_gradient.png (the 32-bit gradient/white PNG), test.py
(an example), and result_output.png (a screenshot of the example as
taken on WinXP).
Have you tried drawing the image yourself instead of letting the static bitmap widget do it?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!