Re: PNG Image not appearing in Skottie

138 views
Skip to first unread message

Florin Malita

unread,
Aug 30, 2023, 8:38:27 AM8/30/23
to skia-d...@googlegroups.com
Skottie defers resource loading to the embedding app, and at the moment skottie.skia.org does not support fetching external images.

The best way to test animations with image assets is to store them inline, base64 encoded ("Include in json" Bodymovin Assets option).  E.g. https://skottie.skia.org/e63151aefbef29a851b1c37c21007fa5?e=true&h=1704&w=786

On Tue, Aug 29, 2023 at 4:27 PM 'Dan Richman' via skia-discuss <skia-d...@googlegroups.com> wrote:
Anyone know why the image in this Lottie json doesn't appear in Skottie?



It works fine if pasted in Lottie Editor, but it fails in Skottie for some reason. Any help would be greatly appreciated. Thanks.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/10a7b8d7-0973-4d16-aa2e-47f3f7cdd081n%40googlegroups.com.
Message has been deleted

craste...@gmail.com

unread,
Aug 30, 2023, 9:29:40 AM8/30/23
to skia-discuss
Oh, was this about fetching external PNG files?  At first, I was confused because none of the links you provided was a PNG file.

Florin Malita

unread,
Aug 30, 2023, 9:44:52 AM8/30/23
to skia-d...@googlegroups.com
On Wed, Aug 30, 2023 at 9:05 AM 'dan.r...@dockyard.com' via skia-discuss <skia-d...@googlegroups.com> wrote:
To clarify, the issue is that Skottie is not recognizing external paths, as Lottie permits.

Skottie (the core multi-platform C++ Lottie rendering library) does support external images: asset loading is externalized to the client, and it's up to the embedding layer to implement the correct handler.  You can totally write a Skottie-based app with external image support today.

You are correct that skottie.skia.org (the test web app) does not fetch external assets.  Sounds like a useful feature to consider.

 
For example:

```
{ "id": "my image", "h": 512, "w": 512, "e": 0, "u": "https://example.com/images/", "p": "image.png" }
```

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

dan.r...@dockyard.com

unread,
Aug 30, 2023, 11:44:39 AM8/30/23
to skia-discuss
Thanks! I was able to figure it out by following ab examples in modules/canvaskit/npm_build/extra.html.

However, now I have another question. In that same file it shows an example of setting the color in a managed animation. However, if I change the color values of `BACKGROUND_FILL` there in doesn't have any effect on the colors of the `sk_drinks` animation. Should that `animation.setColor` work? Any ideas why it doesn't?

Florin Malita

unread,
Aug 30, 2023, 11:59:49 AM8/30/23
to skia-d...@googlegroups.com
Oh, looks like that example is using the wrong label.  Try `$BACKGROUND_FILL`, which is the actual fill layer name in https://storage.googleapis.com/skia-cdn/misc/drinks.json.

dan.r...@dockyard.com

unread,
Aug 30, 2023, 1:14:31 PM8/30/23
to skia-discuss
That worked! Thanks.
Reply all
Reply to author
Forward
0 new messages