Atelier

SVG 1.1 toolkit

ATELIER\SVG

Open-source SVG library for PHP.

Create graphics, edit existing files, and prepare SVG for the web with one fluent PHP API.

Get started GitHub
A curve, built with PHP Two smooth Bézier segments drawn by the PHP example below. Blue anchors and violet control points reveal the geometry behind the curve.
<?php
use Atelier\Svg\Path\PathBuilder;

$path = PathBuilder::startAt(0, 100)
    ->curveTo(60, 0, 140, 0, 200, 100)
    ->smoothCurveTo(340, 200, 400, 100)
    ->toData();

ATELIER PACKAGES

Build on SVG with PHP packages for charts, diagrams, layouts and more.

More tools for your SVG projects

ATELIER\LAYOUT

Arrange graphics with stacks and grids.

ATELIER\BARCODE

Generate QR, Data Matrix and 1D barcodes.

ATELIER\TEXT

Turn font glyphs into portable SVG paths.

ATELIER\PATTERN

Fill surfaces with repeating SVG patterns.

ATELIER\FIELD

Draw landscapes, contours and flows.

ATELIER\RASTERIZER

Render SVG files as bitmap images.

The SVG library

Explore the APIs for documents, shapes, paths, styling and file preparation.

Document

Create, load and save SVG documents.

Elements

Find and edit shapes with CSS selectors.

Paths

Build, measure and transform SVG paths.

Styling

Apply styles, gradients and transforms.

Optimization

Reduce file size with custom pipelines.

Morphing

Animate transitions between SVG shapes.

Guides & use cases

Follow practical recipes for common SVG workflows in PHP.

Sanitize Uploads

Remove scripts, unsafe URLs and event handlers from uploaded SVG before serving it.

Batch Optimize

Optimize a directory of SVG files with a reusable pipeline for your build or CI.

Working with Groups

Group SVG elements to share styles, apply transforms and organize a drawing.

Build Charts

Build a chart from SVG shapes, lay out the data and add accessible labels.

Creating Icons

Create icons with a viewBox, inherited colors and accessible descriptions.

Sprite Sheets

Combine icons into a sprite and reuse them with symbol and use elements.

Animate Shapes

Morph between two SVG shapes and export an animation with your chosen timing.

Accessibility

Add titles, descriptions and ARIA roles so SVG works with assistive technology.

Merge SVG Documents

Combine SVG documents or import selected elements into another drawing.

Convert Shapes to Paths

Convert circles, rectangles and other shapes to paths for morphing or editing.

Place Markers Along a Path

Place markers at regular intervals along a curve using its path geometry.

Crop SVG to its Content

Fit the viewBox to the drawing and remove empty space around its content.

Community

Free and MIT licensed. Contributions of all kinds are welcome, from bug reports to pull requests.

github.com/ateliersvg