Cash App Jul 12, 2023

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

Critical Insight

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.

The post hints at additional challenges still being worked through before the 3.0 release that could reshape the final API.

About This Article

Problem

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.

Solution

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.

Impact

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.