coil-resvg
1.0.0indexedSVG decoder for Coil, rendering vector images to pixel-perfect bitmaps via resvg Rust FFI, with system font support, consistent rendering and no browser dependency.
SVG decoder for Coil, rendering vector images to pixel-perfect bitmaps via resvg Rust FFI, with system font support, consistent rendering and no browser dependency.
A Kotlin Multiplatform SVG decoder for Coil 3, powered by resvg (Rust).
Renders SVG images to pixel-perfect bitmaps using the resvg engine via Rust FFI, with text/font support on every platform.
| Android | iOS |
|---|---|
![]() | ![]() |
| Platform | Status |
|---|---|
| Android | ✅ |
Note: The JS / Wasm (Browser) targets currently use the browser's native SVG rendering pipeline, not resvg FFI.
Add the dependency to your build.gradle.kts:
// build.gradle.kts
dependencies {
implementation("com.hashsequence:coil-resvg:1.0.0")
}
For Kotlin Multiplatform projects, add it to commonMain:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.hashsequence:coil-resvg:1.0.0")
}
}
}
Register ResvgDecoder as a component in your Coil ImageLoader:
setSingletonImageLoaderFactory { context ->
ImageLoader.Builder(context)
.components {
add(ResvgDecoder.Factory())
}
.build()
}
Then load SVG images as usual with Coil:
AsyncImage(
model = "https://example.com/image.svg",
contentDescription = null,
)
That's it — SVG files will be automatically detected and rendered by resvg.
The library uses resvg + tiny-skia compiled as a native Rust library, bridged to Kotlin via UniFFI and Gobley. The SVG is parsed by usvg, rendered to RGBA pixels by resvg, and then converted to a platform-native bitmap (e.g., , , ).
Copyright 2026 HashSequence
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.
|
|
|
|
|
|
|
|
| iOS | ✅ |
| JVM (Desktop) | ✅ |
| JS (Browser) | ✅ |
| Wasm (Browser) | ✅ |
android.graphics.BitmapUIImageBufferedImageSurfaced from shared tags and platforms — no rankings paid for.