Yes, that's why I recommended ARGB_8888, and linked to Romain's excellent 
explanation of the different Configs. But sometimes you can't afford the 
memory for ARGB_8888 for large Bitmaps, which is why I was using RGB_565 in 
the first place. And ARGB_4444 looks fine for some images, so in such a 
case - and if you need the alpha channel - it can still be the best choice.

Bottom line: pay attention to which Config you're using.

String

On Monday, July 16, 2012 1:31:27 PM UTC+2, Fran wrote:
>
> ARGB_4444 is discouraged in google development docs as it produces very 
> poor quality with some bitmaps. And I have checked that it is true. If 
> you have a bitmap with a gradient or something similar, it will look 
> really crappy with ARGB_4444. 
>
>
> On 16/07/12 12:37, String wrote: 
> > Okay, I'll say right up front, there's no good reason why you should be 
> > doing this. If your PNG has an alpha-channel, what are you doing loading 
> it 
> > using a config that doesn't support it? 
> > 
> > Nonetheless, I was doing this in one of my apps; the PNGs had 
> transparency 
> > for historical reasons, but I'd been loading them using RGB_565 to save 
> > memory (the loss in quality wasn't important in this case). And prior to 
> > Jelly Bean, this worked fine, but in 4.1 it failed silently. It appeared 
> to 
> > work, but the resultant bitmap was unusable; saving it to SD for 
> debugging 
> > yielded a 0-length file. 
> > 
> > The solution is simple: either remove the alpha-channel from your PNG, 
> or 
> > load it with a different Config, one that supports transparency. If you 
> can 
> > spare the RAM, ARGB_8888 is generally the best choice 
> > (see https://plus.google.com/u/0/111962077049890418486/posts/Ytar76F56y5). 
>
> > Or if memory's tight, ARGB_4444 will still work, and uses the same 
> > 16bytes/pixel as RGB_565. 
> > 
> > String 
> > 
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to