Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coil-avif multiplatform rendering #2742

Open
vanniktech opened this issue Dec 14, 2024 · 1 comment
Open

coil-avif multiplatform rendering #2742

vanniktech opened this issue Dec 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vanniktech
Copy link

I saw that AVIF support on Android 12+ was added here: #1669

Would it be possible to also have this working on previous Android versions? Additionally with also support for all the other platforms (ios/wasm/desktop)? This could live in a new module like coil-svg

AVIF offers superior compression compared to JPEG and WebP, both in lossy and lossless modes, with support for transparency and high dynamic range (HDR). The only problem is that it isn't widely supported yet.

@vanniktech vanniktech added the enhancement New feature or request label Dec 14, 2024
@colinrtwhite
Copy link
Member

That PR doesn't add support for AVIF - it just ensures we can decode an AVIF image using Coil on Android 12+ using the standard Android decoding classes (BitmapFactory/ImageDecoder). The decoders are built into Android 12+ so we can't backport them.

To support pre-Android 12 and multiplatform we'd have to import and wrap a 3rd party AVIF decoder, which would require importing native libraries. It looks like Glide has an integration for Android that already does this, but it would need more work to integrate with all multiplatform targets I believe. It should be possible to write a custom Coil Decoder that wraps the same library like Glide does and add it to your ComponentRegistry.

If there's enough demand we could consider adding a 1st party Coil library to support this, but we'd need to figure out how to support this on multiplatform first. I'm hoping Skia adds support for AVIF as it would simplify the integration, but I'm not sure if there are plans to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants