I wanted the next release of PN to have some nicer icons, as the roughness of the toolbar images was jarring. The best way to get good looking smooth images on a toolbar is to use images with an alpha channel. Unfortunately this is only supported in XP and up, but I think it’s a worthwhile change for users on those platforms.
It took me a long time to find a good way to produce bitmaps in the correct format for windows to handle the alpha. The bitmaps must be stored as 32-bit where 24 bits are used for the colours and 8 bits for the alpha channel. Very few tools seem to support this format. So here are two methods you can use:
Believe it or not, use MS Paint
First create your image using a good transparency aware design tool like Photoshop or The Gimp. Now save your image as a PNG with transparency. Next, load the PNG into MS Paint and immediately save the file as a bitmap. If you look at the bitmap in a normal editor now you will see a black background but this is caused by the alpha channel. MS Paint claims it’s only a 24-bit bitmap but it truly is 32-bit with alpha.
Alternatively, use a handy tool!
I spent a long time looking for utilities to do this and was beginning to think I’d have to do it myself when I stumbled across AlphaConv by Adam Najmanowicz. This useful tool will transform between .png, .tga and .bmp formats keeping the alpha channel.
Nice Icons
You may recognise the glyphs in the above toolbar as coming from the Silk icon set from famfamfam.com. This excellent set is free, and my thanks to the designer for making PN a prettier piece of software!
At the moment the PN development builds only support the toolbars properly on XP. I have yet to work out the best way to continue using older icons for older OS versions.
4 Comments
Cool! Will this be in a release anytime soon? We haven’t heard much on the pn-devel list lately.
There will be a development release fairly soon (tomorrow if I manage it!) which will go to the pn-devel list first.
There will also be a release of pypn to the list which I don’t expect to publicize for a good two or three revisions!
Hi there !
I just had to drop a note to say thanx for this information and for the link to the conversion tool. I am currently teaching myself to program the windows api and had a hard time finding out how to have nice alpha blended icons on my toolbar. I am just shocked that one can’t depend on a program like Photoshop. I was just about to give up, let my toolbar icons be ugly and program something else. Then I came across this site.
Again, thanks alot,
- Daniel
It’s been a while since I looked, but I believe you can use an .ico image for your toolbar buttons. As I’m sure you know, a .ico file can contain many different image resolutions and bit-depths. You should be able to use a .ico with alpha and have it gracefully fallback to 24-bit when used on older systems.