To do a true comparison of what the PNG is like after 'optimization' take it out of the final APK, it is just a zip archive.
The banding artifacts you see are because the device and the emulator are displaying in 16-bit 565 pixel format, they can't display all the colors. Have you tried painting the image with Paint.setDither(true) turned on: http://developer.android.com/reference/android/graphics/Paint.html#setDither%28boolean%29 On Oct 28, 9:20 pm, Ian <iangm...@gmail.com> wrote: > Hi all, > > I've noticed that the PNGs of my application with some gradients > effects looked terribly bad at the device (a Samsung Galaxy) and at > the emulator, and I've found the following note at the documentation > (http://developer.android.com/guide/topics/graphics/2d- > graphics.html): > > "Note: Image resources placed in res/drawable/ may be automatically > optimized with lossless image compression by the aapt tool. For > example, a true-color PNG that does not require more than 256 colors > may be converted to an 8-bit PNG with a color palette. This will > result in an image of equal quality but which requires less memory. So > be aware that the image binaries placed in this directory can change > during the build. If you plan on reading an image as a bit stream in > order to convert it to a bitmap, put your images in the res/raw/ > folder instead, where they will not be optimized." > > I've tried the res/raw suggestion, but it didn't worked. > > I've tried to use the image as JPEG as a workaround, but I couldn't > use 9-patch. > > I've uploaded a comparison between the original png and the > "optimized" png that is shown on the emulator or > devices:http://www.weka.com.br/temp/img/comparison.jpg > > One workaround would be put the images at /assets/ and manually load > and set the image on the ImageViews, but it requires a lot of code > changes. > > Any ideas? Is there any way to disable this optimization? > > Thanks in advance, > Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---