After Effects export settings for small Lottie files

Most oversized Lottie files are not made by the compressor — they are made in After Effects, long before export. A few settings in the Bodymovin panel and a few habits in the composition itself decide whether your file lands at 40 KB or 40 MB. This article walks through the settings that matter, the composition choices that shrink the output, and what to do with the file once it is exported.

Start with the composition, not the export panel

The single most effective size decision is made before you touch Bodymovin: keep the canvas as small as the design allows, and keep the frame rate as low as the motion allows. Lottie is vector, so it scales crisply to any screen — a 400 × 400 canvas renders just as sharply at 800 × 800 as a native 800 × 800 composition would, while every embedded raster frame is a quarter of the pixels. The same logic applies to frame rate: 30 fps is the usual default, 24 fps is fine for most UI motion, and slow ambient loops often look identical at 15 fps with half the frames to store.

If your animation contains raster layers, these two choices multiply: halving the canvas dimensions and dropping from 30 to 15 fps cuts the raster payload to roughly an eighth. Decide them with the designer at the start of the project, not after the file is already 70 MB.

Bodymovin: assets handling

In the Bodymovin export panel, the Assets section decides what happens to images. The key choice is between embedding images in the JSON and keeping them as separate files. Embedding produces a single self-contained file, which is convenient — but every image is inlined as a base64 data URL, adding about 33% overhead, and the result can be enormous for image sequences. Read why your Lottie file is 70 MB for the full mechanics.

If your pipeline can host images alongside the JSON, exporting them as separate files avoids the base64 tax and keeps the JSON small. If you need a single file — for a CMS upload, an email, or a chat sticker — embed them, and plan to run the result through a compressor afterwards. Either way, check the image compression option in the panel: it lets Bodymovin downscale or recompress images on export, which is worth enabling when the source assets are larger than the animation needs.

Bodymovin: glyphs vs fonts

Text is another quiet source of bloat. Bodymovin offers two ways to export text layers: as glyphs (each character converted to vector outlines) or as fonts (the text stays text, and the player renders it with a font installed on the device).

Glyphs are self-contained and render identically everywhere, but every character used becomes shape data — a long paragraph can add up. Fonts keep the file tiny, but the animation will look wrong, or fall back to a different font, on any device that does not have that font installed. The practical rule: use glyphs for short, fixed text such as labels and numbers, where the character count is small and the exact look matters. Use fonts only when the text is long or dynamic and you control the playback environment.

Hidden layers and unused assets

Bodymovin exports what is in the composition, including things you cannot see. A layer with its visibility eyeball switched off is still exported unless you tell Bodymovin to skip hidden layers — check the setting for it in the export panel. The same goes for guide layers and for assets imported into the project but never placed on the timeline: they bloat the project, not the export, but a layer referencing them will drag them in.

Before exporting, do a quick pass: delete or hide layers that are not part of the final animation, remove unused footage from the project panel, and make sure no layer is sitting far outside the canvas holding a large image that never appears on screen.

Reduce raster effects

The most common reason a Lottie file explodes is raster effects: glows, blurs, particle systems, drop shadows, and anything that After Effects renders as pixels rather than vectors. Bodymovin cannot translate these into Lottie shapes, so it renders the affected layers to a PNG sequence and embeds every frame — the exact mechanism behind the 70 MB files.

Wherever possible, replace raster effects with vector equivalents. A soft shadow can often be faked with a blurred vector shape at low opacity, drawn as a shape layer instead of a layer effect. A glow can be approximated with a radial gradient fill. Particles are harder — if the effect is essential, isolate it to the smallest possible area and the shortest possible duration, so the PNG sequence covers fewer pixels for fewer frames. And ask whether the effect is doing real work: many glows and blurs added during design exploration survive into the final file without anyone noticing them.

Precompose deliberately

Precomposing is a useful tool, but it has a size side effect. When a precomp contains raster effects, Bodymovin renders the whole precomp to frames — including any parts that are masked off, off-screen, or covered by other layers. A precomp that is much larger than the visible region wastes pixels on every frame.

Two habits help. First, keep precomps tight: crop them to the area that is actually visible, and avoid nesting precomps inside precomps unless the structure genuinely needs it. Second, use precomps to isolate the raster parts of an animation from the vector parts, so that only the small raster region is rendered to frames while the rest stays vector.

Frame rate and canvas size, revisited

These deserve a second mention because they are the cheapest wins available. Before exporting, check three numbers in the composition settings: width, height, and frame rate. A loading spinner does not need a 1000 × 1000 canvas, and most UI motion does not need 60 fps — 30 fps is standard, and 24 fps is often indistinguishable. Trim the work area to the exact in/out points; a trailing second of empty frames still costs bytes when raster frames are involved.

After export: run it through the compressor

Even with good export habits, some animations genuinely need raster frames — a photographic texture, a fluid simulation, a complex particle burst. That is what the compressor is for. The lottie-mini compressor runs entirely in your browser: it decodes the embedded PNG frames, re-encodes them as WebP, optionally drops frames to lower the effective frame rate, and rewrites the timeline to match. The sample on the home page — a 70 MB file compressed to about 1.1 MB — shows the scale of what re-encoding and frame skipping can do together.

Before compressing, use the Preview and Inspect tools on the site to see what you are dealing with: the Inspector breaks down how much of the file is images versus vector data, so you can tell whether the export settings above are the problem or whether the file simply needs the compressor. If you are choosing between shipping formats after compression, see dotLottie vs JSON, and if you want the wider comparison, Lottie vs GIF vs MP4 covers when Lottie is the right format at all.

Checklist

  1. Canvas as small as the design allows; frame rate as low as the motion allows.
  2. Trim the work area to the exact in/out points.
  3. Decide assets handling: separate files when possible, embed only when you need a single file.
  4. Text as glyphs for short fixed labels; fonts only when you control the environment.
  5. Skip hidden layers in the Bodymovin panel; delete unused footage.
  6. Replace raster effects with vector equivalents where possible; isolate the rest to small areas and short durations.
  7. Keep precomps tight and shallow; isolate raster regions from vector regions.
  8. Export, inspect, and run the result through the compressor.