Skip to main content
Question

Animated GIFs with createImage

  • October 13, 2022
  • 2 replies
  • 553 views

grant.blakeman

We’ve been using createImage with a plugin for awhile now without issues. But we recently introduced a set of animated GIFs and—unless I am missing something—the animation is getting stripped by this API function and Figma treats the fill as a static image and not a GIF.

As far as I can tell, the Uint8Array that we feed to createImage is the same as what we load from the remote server and are able to preview (with animation) in our UI.

2 replies

grant.blakeman

Possibly related to GIFs not available in the API 🤔


grant.blakeman

Well, not sure when the following was added to the docs, but I had missed it. I’m guessing this is my issue:

The example above won’t work for GIFs, which are more like video files than image files. In fact, <canvas> doesn’t really support GIFs. You will need to use a third-party Javascript library capable of encoding and decoding GIFs.

End of the page on this doc.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings