Introduction to the Image Pipeline
The image pipeline does everything necessary to get an image into a form where it can be rendered into an Android device.
The pipeline goes through the following steps when given an image to load:
- Look in the bitmap cache. If found, return it.
- Hand off to other threads.
- Check in the encoded memory cache. If found, decode, transform, and return it. Store in the bitmap cache.
- Check in the disk cache. If found, decode, transform, and return it. Store in the encoded-memory and bitmap caches.
- Check on the network (or other original source). If found, decode, transform, and return it. Store in all three caches.
This being an image library, an image is worth a thousand words:
(The ‘disk’ cache as pictured includes the encoded memory cache, to keep the logic path clearer.) See this page for more details on caching.
The pipeline can read from local files as well as network. PNG, GIF, and WebP are supported as well as JPEG.