Multiplatform image loading: Coil 3.0
Article Summary
Colin White reveals how Coil 3.0 is breaking free from Android to become truly multiplatform. The image loading library that powers countless Android apps is making a bold leap to iOS, web, and desktop.
Coil, a popular Android image loading library, is getting a major overhaul in version 3.0 to support Kotlin Multiplatform and Compose Multiplatform. White walks through the architectural decisions needed to decouple from Android SDK and enable the beloved AsyncImage composable across all platforms.
Key Takeaways
- Replacing Android's Drawable class with a common Image interface across platforms
- Using Skiko (Skia bindings) for consistent image decoding without platform dependencies
- AsyncImage composable will work identically on Android, iOS, web, and desktop
- Coil's interface-based architecture made multiplatform conversion feasible from the start
Coil 3.0 will bring unified image loading with memory and disk caching to all Compose Multiplatform targets by abstracting away platform-specific graphics APIs.
About This Article
Coil 2.x's coil-compose artifact only worked with Jetpack Compose on Android. iOS, web, and desktop couldn't use the AsyncImage composable's straightforward image loading API.
Colin White's team separated Coil from the Android SDK. They replaced Android's Drawable class with a common Image interface and used Skiko, which provides Skia graphics engine bindings for Kotlin Multiplatform.
Coil 3.0 lets developers write the same AsyncImage code on Android, iOS, web, and desktop through Compose Multiplatform. There's no extra overhead since Skiko is already a Compose Multiplatform dependency.