So I am creating an android game and for the background I am using a gradient done in Photoshop. Now I know you can create a gradient via code in android but I prefer to do it this way. However, the image is supposed to look like this:
But instead ends up looking like this on the phone:
Why is the quality reduced?
2
Answers
I think your mobile device display ability is the problem.
In the market there are many displays with many display resolutions and with many ppi(pixel per inch) values.
So consider above facts.
I’m having the same problem. What I’ve read is that if you add some transparency that might fix it, like if you get the image and add an unnoticable bit of opacity using photoshop or something. This solution did not work for me however.
Another solution I tried is when getting the bitmap I use bitmap options, setting inDither to true like so:
Of course you don’t need to use RGB_565, but that’s what got me the best (though not ideal) results. Also this works if you’re using decodeResource as well, only instead of the stream you’d put in the resource.