PHPackages                             aarsteinmedia/lottie-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aarsteinmedia/lottie-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aarsteinmedia/lottie-php
========================

Create still SVGs from Lottie Animations on the backend, for previews.

0.1.0(2w ago)03PHPPHP &gt;=8.1

Since May 24Pushed 2w agoCompare

[ Source](https://github.com/aarsteinmedia/lottie-php)[ Packagist](https://packagist.org/packages/aarsteinmedia/lottie-php)[ RSS](/packages/aarsteinmedia-lottie-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

lottie-php
==========

[](#lottie-php)

Render still SVG frames from Lottie animations on the server — useful for previews, thumbnails, and CMS integrations without a browser runtime.

Supports **Lottie JSON** (`.json`) and **dotLottie** (`.lottie`) files.

Requirements
------------

[](#requirements)

- PHP 8.1+
- `ext-zip` (for `.lottie` archives)

Installation
------------

[](#installation)

```
composer require aarsteinmedia/lottie-php
```

Usage
-----

[](#usage)

Render a single frame to an SVG string:

```
use LottiePHP\LottieToSVG;

$svg = LottieToSVG::renderFrame('/path/to/animation.json');
```

By default, the **middle frame** is rendered. Pass a frame index to pick another:

```
$svg = LottieToSVG::renderFrame('/path/to/animation.json', frame: 0);
```

Optional renderer settings (size, aspect ratio, CSS class, etc.):

```
$svg = LottieToSVG::renderFrame('/path/to/animation.lottie', [
    'width' => 512,
    'height' => 512,
    'preserveAspectRatio' => 'xMidYMid meet',
], frame: 0);
```

### Batch rendering

[](#batch-rendering)

When rendering many frames from the same file, load once and reuse the animation instance:

```
$anim = LottieToSVG::loadCached('/path/to/animation.json');

foreach ([0, 15, 30] as $frame) {
    $svg = LottieToSVG::renderFrameFromAnimation($anim, $frame);
}
```

`loadCached()` skips re-parsing when the file path and modification time are unchanged. `renderFrame()` uses this automatically when no custom renderer settings are passed.

Development
-----------

[](#development)

Clone the repo, run `composer install`, then start the visual smoke-test UI:

```
composer visual:up
```

Open  to browse sample animations and inspect rendered SVG output.

Other scripts: `composer lint`, `composer visual:down`, `composer visual:logs`.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance97

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

16d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17679744?v=4)[Johan Martin Aarstein](/maintainers/johanaarstein)[@johanaarstein](https://github.com/johanaarstein)

---

Top Contributors

[![johanaarstein](https://avatars.githubusercontent.com/u/17679744?v=4)](https://github.com/johanaarstein "johanaarstein (101 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/aarsteinmedia-lottie-php/health.svg)

```
[![Health](https://phpackages.com/badges/aarsteinmedia-lottie-php/health.svg)](https://phpackages.com/packages/aarsteinmedia-lottie-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
