Atelier

Installation

Package

composer require atelier/rasterizer

Requires PHP 8.3+. Runtime dependencies are symfony/process and psr/log. psr/log is only an interface dependency; pass a concrete logger if you want process execution logs. atelier/svg is optional: build documents with it if you like, but any SVG markup string works.

Rasterizer binaries

The package shells out to a rasterizer binary. Install at least one. Rasterizer::create() checks adapters in this order:

Class Binary
ResvgRasterizer resvg
RsvgConvertRasterizer rsvg-convert

Quick binary install

These commands are package-manager examples. Follow the linked package pages for supported versions, platforms, and distro-specific naming.

macOS with Homebrew:

brew install resvg
# or
brew install librsvg

Sources: Homebrew resvg formula, Homebrew librsvg formula.

Debian / Ubuntu-family systems:

apt install librsvg2-bin

Sources: Debian librsvg2-bin package, Ubuntu librsvg2-bin package search.

Fedora:

dnf install librsvg2-tools

Source: Fedora librsvg2-tools package.

For CI and production, pin the chosen binary and version through your system package manager, base image, or release artifact.

Binary licenses

The package shells out to these tools; it does not redistribute them.

Binary Project License
resvg linebender/resvg Dual licensed Apache-2.0 or MIT.
rsvg-convert GNOME librsvg LGPL-2.1-or-later.

Distribution packages can carry extra metadata or patches; check your distro's package page when license compliance matters.

resvg

# macOS
brew install resvg

# cargo
cargo install resvg

# or download a release binary
# https://github.com/linebender/resvg/releases

rsvg-convert

# macOS
brew install librsvg

# Debian / Ubuntu
apt install librsvg2-bin

# Fedora
dnf install librsvg2-tools

Other operating systems and install methods

  • resvg publishes binaries and source releases on GitHub releases.
  • resvg can also be installed from Rust with cargo install resvg; see the resvg project.
  • rsvg-convert is distributed with GNOME librsvg; see the librsvg documentation and project repository.
  • On Windows, resvg is the simpler option: download a Windows release or install it with Cargo, then make resvg.exe available in PATH or pass binaryPath explicitly.
  • rsvg-convert on Windows usually comes from a Unix-like packaging environment such as MSYS2; see the MSYS2 librsvg package.

The PHP package has no OS-specific process code: it runs wherever the target executable is reachable through PATH or given as binaryPath.

Verifying a binary

A rasterizer resolves its binary through PATH. Confirm it is reachable and print the installed version with:

resvg --version
rsvg-convert --version

Rasterizer::create() does not run --version itself: it only resolves the path. No binary is executed until rasterization.

When a binary lives outside PATH, use the lower-level adapter directly and pass an explicit path:

use Atelier\Rasterizer\Adapter\ResvgRasterizer;

new ResvgRasterizer(binaryPath: '/opt/homebrew/bin/resvg');

If neither the configured path nor PATH yields the binary, the rasterizer throws BinaryNotFoundException.