Skip to main content
J
1d ago

Deleted assets still contribute to exported `.riv` size

I've encountered an issue where if I add assets and then later remove them the exported size of the .riv file doesn't get smaller even though I've deleted the assets. This produces an unfortunate side-affect that adding any asset such as a PNG sequence or a Lottie file permanently affects the size of your outputted animation. Is this because it's being stored in the revision history?

How I encountered the bug.
I imported some Lottie files that utilized PNG sequences, but noticed that the files were too large. So I deleted the assets from Rive, compressed them, then re-imported them. However when I went to export the animation the .riv file was now larger than the original export!

I've done additional experiments and came to the conclusion that for some reason removing assets doesn't actually reduce the size of the export.

Will add example .rev when I get the chance later today.

7 replies
J
1d ago

Hi Josh,

Items in the assets panel shouldn't affect the file size of the .riv at all, unless they're being used in an artboard. If they are affecting size, there is definitely a bug. When you get a second to export the .rev, I'll take a closer look.

Thanks,
Lance

J
22h ago

Hey Lance,

Here are the .rev files. I created two projects.

The first one has the original lotties I imported. When exporting it gives me a .riv file of 37mb.

The second one I imported the original lotties, deleted them, and then imported a compressed version of the same lotties. When exporting it gives me a .riv file of 45.7mb.

All of this was done on my M3 Macbook Pro using the desktop app.

no_deleted_lotties.rev
86 MB
has_deleted_lotties.rev
22 MB
22h ago

Thanks! Now I see what's going on. The size of the .riv is affected by the elements on the artboards, not by unused assets in the Assets panel. In your case, you've removed the lottie, but you still have all of the images that came from the Lottie files being used inside your artboards. If you some of those images, you'll see the file size go down.

Here are the 2 things I'd recommend:

  1. Recreate these animations with Rive. Instead of having 100+ images, separate the eyes, the body, and the hands into separate parts and animate them using the timelines.

  2. If you can't do that, at least convert your PNGs to WebP.

If you convert the PNGs to WebPs, you'll also see a significant improvement.

I'm looking at the first animation and I think it could be recreated a lot more efficiently in Rive. Instead of having 100 or so images

J
20h ago

Hello. Thanks for looking into this. However it still doesn't explain why the export of no_deleted_lotties.rev is smaller than has_deleted_lotties.rev (on my machine at least) esp since the pngs and lotties are smaller than in the original.

Also yeah I'm aware that recreating the animations in Rive would be better. I'm not actually an animator. I'm a developer who's been given lotties during handoff and I'm trying to boost performance since the lotties are crashing on older devices.

In my defense. I tried to push for Rive, but I don't think the animator wanted to learn a new tool. So I got outvoted sigh.

(I have been converting to WebP and it has been helping.)

J
(edited) 20h ago

I should also reiterate.

Both files have the same number of images in them. In the one labelled "has_deleted_lotties.rev". I did the following:

- imported the original large lotties
- added the large lotties to the artboard
- deleted the lotties from the artboard
- deleted the lotties from the asset folder
- imported the compressed version of the lotties with smaller pngs
- added the compressed lotties to the artboard
- hit export

the export is larger even though the images are smaller.


J
20h ago

But I'm realizing that maybe Rive doesn't like the image compression I was using, because I guess Rive does it's own image compression...? I'm not sure but that's a potential reason.