Why android lose image quality when displaying a png file?
android, image
Solution
Images in `res/drawable` are compressed. This is supposed to be lossless, but I've heard of similar issues in the past.
Move it into `res/raw`, and give it a go.
Problem
I want to display a png image on android. This is the image file: The right end is a bit darker than left. But the quality of image lost on android application(using ImageView): Please note part in the red frame. The color is not changing smoothly. But if I use the browser of my android phone, it plays good(so it's not reason of the phone screen): This is my android code, which is pretty simple: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/hhh"/> </LinearLayout> ``` where `hhh` is my first image posted here, which is under `res/drawable`. I test it on my android phone(android 2.3.6) and android simulator(with android 2.2/2.3/4.0), all do not display good. But it plays good on my android pad(android 4.0.3). What's the problem, and how to fix it?