Factors affecting .png quality

Having followed on online tutorial explaining how to produce custom gui components, I now have a simple button in .psd format that I’d like to convert for
use in wxpython. The problem is, no matter what options I check or uncheck in the save file dialog in photoshop, the generated png file is almost unrecognisable
when used in my app (see attachment). When I view the .png file in the OS X finder window it looks okay. Any icons I grab off the internet render perfectly, so I’m wondering
what It is I’m doing wrong. What information does wxpython need from a png file that I’m not providing? Of course, I realise this question could just as easily be posted on
a photoshop forum, and will be doing so in due course

Thanks,

Paul

Top frame.png

Can I suggest trying 2 things, 1/ Try importing the .png in the
appropriate demo in the Docs & Demo package - this will tell you if the
.png produced by photoshop is the problem rather than your settings
where you are using it and 2/ make sure that before you export it from
photoshop resize the image to the exact size that you are going to be
using. (OT) try using GIMP 2 rather than PhotoShop.

Gadget/Steve

···

On 29/09/2012 10:31 PM, Paul wrote:

Having followed on online tutorial explaining how to produce custom
gui components, I now have a simple button in .psd format that I'd
like to convert for
use in wxpython. The problem is, no matter what options I check or
uncheck in the save file dialog in photoshop, the generated png file
is almost unrecognisable
when used in my app (see attachment). When I view the .png file in the
OS X finder window it looks okay. Any icons I grab off the internet
render perfectly, so I'm wondering
what It is I'm doing wrong. What information does wxpython need from a
png file that I'm not providing? Of course, I realise this question
could just as easily be posted on
a photoshop forum, and will be doing so in due course

Thanks,

Paul

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I placed my file in the folder used to store the bitmaps for the wxDemo, and was surprised to see that It displayed correctly. Taking account
of how this demo rendered the images, I returned to my file and instead of trying to display the image as part of a wxBitmapButton, I placed it in a StaticBitmap.
Again, all was well; suggesting that the problem was not with the bitmap itself but with the wxBitmapButton widget.
Sure enough, it appears there is an issue (bug?) with the BitmapButton border flag: when I set the border flag to something other than the default, the
button appears and behaves as expected. All this happens on OS X/wxpython 2.8.12, and the issue may be specific to this platform. What’s more ,I see that
in later versions of wxpython, the normal wxButton allows the use of an image, so wxBitmapButton appears pretty redundant anyway

Paul.

···

Some types of native widgets on Mac (especially the Carbon builds) require that the images be certain stock sizes, and wx will try to resize an image to one of those sizes in the cases where it is required. I don't remember the specific cases at the moment, but from your screenshot that is what I would guess was happening.

···

On 9/30/12 12:57 PM, Paul wrote:

I placed my file in the folder used to store the bitmaps for the wxDemo,
and was surprised to see that It displayed correctly. Taking account
of how this demo rendered the images, I returned to my file and instead
of trying to display the image as part of a wxBitmapButton, I placed it
in a StaticBitmap.
Again, all was well; suggesting that the problem was not with the bitmap
itself but with the wxBitmapButton widget.
Sure enough, it appears there is an issue (bug?) with the BitmapButton
border flag: when I set the border flag to something other than the
default, the
button appears and behaves as expected. All this happens on OS
X/wxpython 2.8.12, and the issue may be specific to this platform.
What's more ,I see that
in later versions of wxpython, the normal wxButton allows the use of an
image, so wxBitmapButton appears pretty redundant anyway

--
Robin Dunn
Software Craftsman