Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Image Loading Libs

Android Image Loading Libs


Ersin Ertan

July 10, 2015


  1. Image Loaders Intro github.com/facebook/fresco /bumptech/glide /square/picasso

  2. Considerations: • Memory consumption of displayed image • what is

    cached • API features • library size and method counts • web services like: Thumbor -smart image detection, on-demand crop, resizing and flipping of images
  3. Keep In Mind Default behaviours can be modified to be

    more or less like the other.
  4. Image Standards: GIF / WebP / JPG WebP(lossy and lossless

    compression for photographic, translucent and graphical images) Open sourced by Google WebP 24-bit RGB color, 8-bit alpha GIF's 8-bit color, 1-bit alpha Animated GIFs to lossy WebPs (64% smaller), lossless WebPs (19% smaller) More CPU time for memory trade off, smaller than JPEG with no noticeable difference
  5. General Features: • resizing • cropping • image shape transformation

    • placeholder and error images • thumbnail support • lifecycle integration • scroll update speed
  6. Fresco “Images stored in ashmem heap(The anonymous shared memory (ashmem),

    subsystem uses a Unix-y, file-based, shared memory interface to user-space, which may implement caching and similar resource management that efficiently integrates with kernel memory management.” animated GIF and WebP images, progressive jpeg streaming, default HttpURLConnection, can integrate OkHttp to pipeline MVC: DraweeHierarchy, DraweeView, DraweeController
  7. Glide Image loading would be integrated with Activity/Fragment's lifecycle RGB_565

    (50% less memory) with slight visual artifacts caches ImageView’s size image per use case(more memory) can use OkHttp ModelLoader provides view size, allowing for configurable url selection Emphasis on smooth scroll
  8. Picasso ARGB_8888 - same memory consumption when both use ARGB

    caching full image then resizes(more processing) no GIF but WebP automatically uses OkHttp if found as dependency
  9. Examples

  10. https://github.com/ersin-ertan https://plus.google.com/+ErsinErtan1 Ersin Ertan