Problem
On Android, PNGs containing transparency/semi-transparency (such as shadows and glow) look very bad compared to both the iPhone version and the Photoshop reference mockup (see attached screenshots).
The PNGs are normal 32bit (RGBA) straight from Photoshop and looks fine in iPhone simulator. On Android both the emulator and device (HTC Legend) are affected.
Test case
The test is made up of a Window with a background PNG, and two child views with unscaled background PNG's with both solid and semi-transparent content.
Assets are attached
var win = Ti.UI.createWindow({
backgroundImage:'bg.png',
});
var shadow = Ti.UI.createView({
backgroundImage:'shadow.png',
width:'179dp',
height:'179dp',
top:'25dp',
});
var glow = Ti.UI.createView({
backgroundImage:'glow.png',
width:'189dp',
height:'189dp',
bottom:'15dp',
});
win.add(shadow);
win.add(glow);
win.open();
Discussions
Q&A: [severe android png rendering bug](
http://developer.appcelerator.com/question/127038/severe-android-png-rendering-bug)
http://www.curious-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/ {quote} Simple performance test shows very clearly that using a compatible format (32 bits bitmap on a 32 bits window or 16 bits/565 bitmap on a 16 bits window) is the most efficient way to draw bitmaps. For this reason, you should always check the format of your bitmaps and windows and try to make them compatible with each other. {quote} This code in onCreate() may work:
Workaround: ship 16-bit PNGs for android
Closing because it is a duplicate of [TIMOB-24465] which will be resolved soon.