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.
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
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.
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:
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.
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
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.)
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.
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.
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.
Thanks for fighting the good fight. :D
I'm looking at the 2 .rev files you shared and both still seem to have the lottie files in the assets folder:
I went into the brain_confused
lottie, selected all the PNGs and converted them to webP (see Export options
in the bottom right). Even just converting that group knocked it down from 42mb to 28mb for me.
I suppose my explanation wasn't clear enough. In the file labeled "has_deleted_lotties" I imported the original uncompressed lotties, added them to the artboard, deleted them from assets and the artboard. Then reimported a compressed version of the same lottie files, but even though the reimported version is smaller the outputted .riv
is larger
However looking into it further. I think this is more a result of Rive not playing well with the compressed JSON format produced by the lottiefiles website. (Although I can only speculate)
I did convert the images to webP as you said the result is much better