PHPackages                             pavlm/ffi-librsvg - 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. pavlm/ffi-librsvg

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

pavlm/ffi-librsvg
=================

SVG rasterization library binding

v1.0.1(2y ago)23.7k↓33.3%PHPPHP ~7.4 | ~8.0

Since Jul 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pavlm/ffi-librsvg)[ Packagist](https://packagist.org/packages/pavlm/ffi-librsvg)[ RSS](/packages/pavlm-ffi-librsvg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

pavlm/ffi-librsvg
=================

[](#pavlmffi-librsvg)

PHP binding for `librsvg2`. It allows conversion (rasterisation) of SVG image to PNG, with minimal dependencies.

Why
---

[](#why)

Recommended way to convert SVG in PHP is by using the ImageMagick extension. However, its SVG functionality may be limited depending on your system libraries. The actual conversion process is performed by `imagemagick-6.q16`, which has optional SVG support. For full SVG support, proper compilation is required, and in the background, it utilizes `librsvg2`.
There are alternative conversion methods available, but they require cross-process communication.

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

[](#installation)

```
sudo apt install librsvg2-2
composer require pavlm/ffi-librsvg

```

Usage
-----

[](#usage)

```
