Image compression for Android developers - Google I/O 2016
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about reducing APK size, speeding up image loading, and choosing or tuning image formats on Android.
Recommended by 5 people across 5 different months, 2011 to 2019.
What it is
A Google I/O 2016 session from the Android Developers channel on how image compression works for common file formats and how to use that knowledge to shrink images in Android apps. It covers practical optimization of bitmaps loaded over the network, aimed at any Android developer.
Cited in 1 Wikipedia article, including Guetzli.
What people said
Recommends Lukas Knuth · 2011-10 · Stack Overflow · on “Large app size due to images. How to compress .PNG images?”
.png -files which are placed in the res/drawable are automatically optimized [LINK] when compiling your app: Bitmap files may be automatically optimized with lossless image compression by the aapt tool during the build process. 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. That being
Recommends John Gallagher · 2016-06 · Stack Overflow · on “Multiple images in Android app”
It shouldn't impede the performance of your app in any way, however you may want to consider clever ways of compressing the images to reduce APK size or the times to load individual images i.e vector drawables or webp. See [this video]
Recommends mayosk · 2016-08 · Stack Overflow · on “Android - Optimizing application performance by image compression”
Try to use some of compress tools like [LINK] or [LINK] , android studio has bundled some image optimization, if you want to know more watch Google I/O session about it. [this video]
Recommends UmAnusorn · 2017-08 · Stack Overflow · on “How to Load Image faster in Custom List view getting values from server?”
I would recommend to use recyclerView [LINK] in stead of listView Try Fresco [LINK] or Glide [LINK] Compress/reduce size of image. May be you can try Photoshop [LINK] or watch how to optimize image on Android [this video] E.g. reduce color. Cache image / pre-download Try to verify the server response speed if it is low then try another server or cloud. Send the smallest images for each screen dpi.
Recommends Morrison Chang · 2019-06 · Stack Overflow · on “How to get frame by frame from MP4? (MediaCodec)”
Please check out: Android Developer Blog Post on Game Textures [LINK] , OpenGL Texture Compression Support [LINK] and Image compression for Android developers - Google I/O 2016 [this video] for more normal Android development
Cites Pablo Insua · 2018-02 · Stack Overflow · on “Compress bitmap or byte[] after taking picture”
I know that the question has some time, but I think this answer could help someone. There are three methods to compress your picture (the " byte[] data " you have recieved from the Camera): 1) PNG format -> It's the worst choice when the image has a lot of different colors, and in general, this is the case when you take a photo. The PNG format is more useful in images like logotypes and stuff like this. The code: String filename = "" //THE PATH WHERE YOU WANT TO PUT YOUR IMAGE File pictureFile = new File(filename); try{ //"data" is your "byte[] data" FileOutputStream fos = new FileOutputStream(pictureFile); Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length); bmp.compress(Bitmap