Battle of the Bands with WP7 and Image Banding
Nov
14
Written by:
Monday, November 14, 2011 9:33 PM
Image banding is not pretty, especially on YOUR brand new and cool app! So why let it happen? I show you an EASY fix!

Ok, so you’re into WP7 development, AWESOME! You and I can be great friends! And as your brand new friend I want to let you in on a little secret I just found out today from Long Zheng at istartedsomething.com. Check out the image on the left, do you see the “horizontal lines” in the image as the gradient goes from red to blue? Oh, and for you Leafs fans out there, uh…hhhhmmm….well, you’ll just HAVE to get past the centre distraction! haha
But seriously, you see the “banding” in the image? Kind of ugly eh? “Uh hello, this is the 80s calling, we’d like our VGA colour graphics adapters back!” DOH! Ok, ok a bit of exaggeration…but is there a way to remove this? The quickie is YES!
The good news is, yes there is a way and it’s easy! The bad news is it could have a performance impact. The other good news is, if you don’t care about the POTENTIAL theoretical performance loss, you set it ONCE and it’s good for your whole application!
GOOD! So Peter where do I set this? Easy, open the WMAppManifest.xml file and add the BitsPerPixel to the App node. Oh, you’ll KNOW if you open the wrong file (like the AppManifest.xml like I did, DOH!), if you update that one, first you won’t see anything useful for the intellisense AND if you continue, your app will hang on the startup image/screen. So if you see that, reread this paragraph and open the OTHER manifest file. haha

Side Note: If you’re reading this and scratching your head going……..uh…Peter, I didn’t make that change you mentioned and I don’t see any “banding” on my screen. hhmm let me guess you’re looking at your MainPage (or other page) in Visual Studio or Blend right? Right? RIGHT? Ya, I know! I caught THAT ONE too! VS and Blend are using a different rendering engine than what the emulator and the real phone are using! Ya, but try F5-ing your code and if you didn’t make the change I mentioned in the WPAppManifest.xml, I’ll bet you a Timmy’s double-double you’ll be tempted to!!!!
Ok, now that you’ve updated/edited the WMAppManifest file, just F5 and watch the graphics smoothly transition on your screen!
There you go! You’re all good! Now that you know the secret to winning the battle of the bands, it’s time to grab a coffee and get coding!
PS If you’re part of the crew which say “don’t do that cause you’ll degrade your performance." I really want to hear from you. I would like to know the REAL impacts, not the theory stuff. What I mean is, I want to know how much battery this one setting costs, or maybe how much the graphics are slowed down. If you know, please leave a comment, I would LOVE to read what the actual and real life trade offs are for this.
Resources
istartedsomething.com: Death to banding: Windows Phone devs, please upgrade your apps to 21 BitsPerPixel by Long Zheng
MSDN: Application Manifest File For Windows Phone
PCHenry.com: SVN source code URL
4 comment(s) so far...
[WP7] Quick tip : how to set 32 bits per pixel for your app.
Something new which came with Mango is the ability for the developers to set the number of bits per pixel our app use. By doing this, your app will have shiny graphics! This increase the color depth and then the gradient are rendered really more smooth... # Jonathan ANTOINE's thoughts on WPF, Silverlight, WinRT, NUI...
By TrackBack on
Monday, January 09, 2012 8:44 AM
|
Re: Battle of the Bands with WP7 and Image Banding
Like minds think alike?! COOL! I was JUUUUUST thinking of adding your link here this morning (morning coffee seems to clear the Monday morning cobwebs! haha). Thank you for your comment and have a great week!
PS If you're a new reader, WELCOME! If you're wondering if this "hack" is worthwhile, I'm not the only one recommending it, others are trying/using it too! So why not you too?! haha
By Peter Henry on
Monday, January 09, 2012 9:47 AM
|
Re: Battle of the Bands with WP7 and Image Banding
Hi Jonathan. Are you visiting this link? Are you hitting a refresh by any chance or have the comment page as the favourite? I'm getting multiples of comment entries, three in the last 5-10 minutes. haha Just wondering thats all. Hey, I'm all for comments/talking! ahaha But if you're trying to add multiple comments, it's the same one which I usually delete (well, cause it's duplicates of the original, sorry). Have a good week!
By Peter Henry on
Tuesday, January 10, 2012 2:10 PM
|
Re: Battle of the Bands with WP7 and Image Banding
Gabriel Minárik also wrote an article about this banding, but he also added some good reasons why MS went the "other" way. It's a good and short read (his pic is nice, and so's his Samsung phone too! haha)
wp7developers.wordpress.com/2012/01/12/death-to-banding-windows-phone-devs-please-upgrade-your-apps-to-32-bitsperpixel
By Peter Henry on
Friday, January 13, 2012 9:20 AM
|