[Canvaskit / Skottie] Image layer with svg asset?

163 views
Skip to first unread message

Marcus Stenbeck

unread,
Oct 16, 2021, 9:32:29 AM10/16/21
to skia-discuss
Thanks a million for the work on Skottie and Canvaskit. I love it.

I noticed that image assets in a Bodymovin composition only seem to render when using PNG or JPEG (possibly WEBP too but I haven't tried it).

Is it possible to use SVG image assets or is that a no go?

Florin Malita

unread,
Oct 18, 2021, 11:49:25 AM10/18/21
to skia-discuss
Does AE/Bodymovin support working with and exporting SVG image assets?  Or you're planning to replace them after export?

At the moment it's a no-go, mostly because Canvaskit is not configured to "decode" SVGs.  It's an interesting idea though, I think it could work:

  - enable SVG support in Canvaskit
  - write a small Skottie resource provider adapter to handle SVG images

Marcus Stenbeck

unread,
Oct 19, 2021, 7:07:08 AM10/19/21
to skia-discuss
Ah, no. You're right. AE doesn't support SVG assets at all. It doesn't make a lot of sense to add such support. Most people won't run into the need for using SVG:s. I think I'll just construct an HTML image element and feed the raw data into CanvasKit/Skottie.

My use case is a bit strange since I'm building a web based Lottie editor type of app. SVG just felt like something natural to the web and something Canvas2D, and therefore also CanvasKit, would handle. But Canvas2D doesn't have direct SVG support so I think this is a convenience I won't have. 

Thanks for the fast response tho!

Reply all
Reply to author
Forward
0 new messages