[SOLVED] Gradients in image have severe banding

All your problems with Audio, Video and Images.

[SOLVED] Gradients in image have severe banding

Postby dfetter88 » Thu Jul 15, 2010 12:10 am

I've been trying for the last few hours to create a background for one of my apps. The image has gradients, and displaying them on my emulator results in very ugly banding issues. I've linked to images for a visual.

Original:
Image
In Emulator:
Image

After googling for a while, it seems that this is due to Android only allowing 16-bit color palletes. This is a problem for me because I need some sort of gradient. I've searched for quite some time and would appreciate any help.
Last edited by dfetter88 on Fri Jul 16, 2010 4:05 am, edited 1 time in total.
dfetter88
Freshman
Freshman
 
Posts: 6
Joined: Fri Jul 02, 2010 5:09 am

Top

Re: Gradients in image have severe banding

Postby blundell » Thu Jul 15, 2010 9:24 am

I read about this somewere, I think it was developer.android on the widget page, they give you some stock images and say add 'noise' to reduce banding.

This is confirmed by this link: http://androidforums.com/htc-evo-4g/115 ... ients.html

Which also links to: http://www.planetphotoshop.com/say-good ... nding.html

Which then links back to my superior skills and your favourite resource DEV.AND ! :
http://developer.android.com/guide/prac ... tml#tricks

Image

In some cases, devices have low pixel depths that can cause visual banding and dithering issues. To solve this, application developers should pass assets through a "proxy" drawable defined as XML:. This technique references the original artwork, in this case "background.9.png", and instructs the device to dither it as needed


Keywords: Android, Banding, Images, Tearing, Image, Resolution, Poor, Quality, PNG, Gradiant, Drawable
Last edited by blundell on Fri Jul 16, 2010 8:36 am, edited 1 time in total.
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: Gradients in image have severe banding

Postby dfetter88 » Thu Jul 15, 2010 1:35 pm

Thanks for your response! I'll look into that today. I've also found that placing the image in the 'res/raw/' directory instead of 'res/drawable/' provides some substantial improvement as well.
dfetter88
Freshman
Freshman
 
Posts: 6
Joined: Fri Jul 02, 2010 5:09 am

Re: Gradients in image have severe banding

Postby dfetter88 » Fri Jul 16, 2010 4:04 am

I combined these two tricks and now cannot see any banding at all! Worked great.
dfetter88
Freshman
Freshman
 
Posts: 6
Joined: Fri Jul 02, 2010 5:09 am

Re: [SOLVED] Gradients in image have severe banding

Postby RikoZenro » Fri Jan 28, 2011 8:13 am

Great technique on how to remove banding. Glad you have resolve your problem about severe banding, good for you.
RikoZenro
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jan 28, 2011 7:47 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 20 guests