PHPackages                             mober/phpsvg - 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. mober/phpsvg

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

mober/phpsvg
============

Edit and create SVG Documents using OO PHP

v5.0.1(2y ago)02.4k—0%[1 issues](https://github.com/m-ober/phpsvg/issues)GPL-3.0PHPPHP 8.0 - 8.3

Since Dec 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/m-ober/phpsvg)[ Packagist](https://packagist.org/packages/mober/phpsvg)[ Docs](https://github.com/m-ober/phpsvg)[ RSS](/packages/mober-phpsvg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (28)Used By (0)

phpsvg
======

[](#phpsvg)

Edit and create SVG documents using PHP. This library is a fork of `mewebstudio/phpsvg`, which was last updated in 2013.

Features
--------

[](#features)

- Open and edit SVG and SVGZ (GZipped)
- Generate thumbnails or export to PNG, JPG, GIF, PS, EPS, PDF
- Support embedded or linked images
- Strict typing, i.e. `declare(strict_types=1);`

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

[](#installation)

- Version 4.x supports PHP 8.0 and newer, because some features (like fluent methods) require language features that were not available in earlier versions.
- Version 3.x is no longer maintained and supports PHP 7.1 to 8.0.

Install using composer:

```
composer require mober/phpsvg

```

Example
-------

[](#example)

```
$svg = new SVGDocument();

$gradient = new SVGLinearGradient([
    // Set style using fluent methods
    (new SVGStop(0))->setColor('blue')->setOpacity(1),
    (new SVGStop(0.8))->setColor('cyan')->setOpacity(0.5),
]);
$svg->addDefs($gradient);
$svg->addShape(
    new SVGRect(10, 20, '100', '200', (new SVGStyle())->setFill($gradient))
);

$radial = new SVGRadialGradient([
    // Set style as string
    new SVGStop(0, 'stop-color:yellow;stop-opacity:1'),
    new SVGStop(0.7, 'stop-color:green;stop-opacity:1'),
]);
$svg->addDefs($radial);
$svg->addShape(
    new SVGCircle(250, 120, 100, (new SVGStyle())->setFill($radial))
);

$svg->writeXML('demo.svg', humanReadable: true);
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 84% 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

Every ~77 days

Recently: every ~279 days

Total

26

Last Release

64d ago

Major Versions

v1.0.1 → v2.0.02020-12-29

v2.0.1 → v3.0.0-beta.12021-01-02

v3.1.3 → v4.0.0-beta.12022-10-14

v4.0.1 → v5.0.02023-10-30

v5.0.1 → v6.0.0-beta.12026-03-15

PHP version history (6 changes)v1.0.0PHP ^7.1

v3.1.1PHP 7.1 - 8.0

v4.0.0-beta.1PHP ~8.0 | ~8.1

v4.0.0-beta.6PHP ~8.0 | ~8.1 | ~8.2

v5.0.1PHP 8.0 - 8.3

v6.0.0-beta.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd8c734d12bc395c7a9b08c5946e3ff076a449c9fae58134faa43d697c7795df?d=identicon)[mober](/maintainers/mober)

---

Top Contributors

[![m-ober](https://avatars.githubusercontent.com/u/11992838?v=4)](https://github.com/m-ober "m-ober (63 commits)")[![dampfklon](https://avatars.githubusercontent.com/u/1733625?v=4)](https://github.com/dampfklon "dampfklon (10 commits)")[![trialforce](https://avatars.githubusercontent.com/u/18430765?v=4)](https://github.com/trialforce "trialforce (2 commits)")

---

Tags

phpsvg

###  Code Quality

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mober-phpsvg/health.svg)

```
[![Health](https://phpackages.com/badges/mober-phpsvg/health.svg)](https://phpackages.com/packages/mober-phpsvg)
```

###  Alternatives

[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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