Is it possible to decode and encode HEIC image format? #927
-
I am using Skia in a Flutter project. Flutter supports HEIC decoding, but transferring image pixel data to the Rust side requires an additional copy. If Skia could encode and decode the HEIC image format, it would eliminate the need for this extra copy, thereby improving performance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
We could add a matching feature and try to support the codec if defined. And to confirm, this is Android only, and adds an external dependency to the libheif library. But from a practical perspective, I am not sure if it makes sense to include another? copy of Skia to save an extra memory copy. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response and for this fantastic library. It would be amazing if there could be a HEIC feature similar to the webp feature someday. I am a bit curious as to why it is Android only, as Skia and libheif don't seem to have this limitation. The reason I need to introduce another Skia is that I originally used SwiftUI, and later switched to Flutter for cross-platform capabilities. Moreover, I don't want to be too deeply tied to a GUI framework and prefer to have the flexibility to switch to different GUI frameworks when necessary. Additionally, Flutter does not expose all of Skia's features, such as the inability to directly draw dashed lines, lack of SVG support, and more. Also, Flutter is transitioning to the Impeller rendering engine. Flutter requires copying the image pixel data before passing it to the Rust side, which happens at runtime and can significantly impact performance. However, if the image data is passed from the Rust side to Flutter, no copying is required. |
Beta Was this translation helpful? Give feedback.
We could add a matching feature and try to support the codec if defined. And to confirm, this is Android only, and adds an external dependency to the libheif library.
But from a practical perspective, I am not sure if it makes sense to include another? copy of Skia to save an extra memory copy.