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
Tweet

More Decks by Ersin Ertan

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. General Features: • resizing • cropping • image shape transformation

    • placeholder and error images • thumbnail support • lifecycle integration • scroll update speed
  4. 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
  5. 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
  6. 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