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

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

nplavsic/phpsvg
===============

Edit and create SVG Documents using OO PHP

0.9.0(8y ago)032GPL-3.0PHP

Since Dec 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nikolaplavsic/phpsvg)[ Packagist](https://packagist.org/packages/nplavsic/phpsvg)[ Docs](https://github.com/nikolaplavsic/phpsvg)[ RSS](/packages/nplavsic-phpsvg/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

phpsvg
======

[](#phpsvg)

Edit and create SVG Documents using OO PHP

Features:
---------

[](#features)

- Open and edit SVG and SVGZ (GZipped)
- Generate thumbnails or export to PNG, JPG, GIF,PS,EPS,PDF
- Support embebed or linked images.
- Use php features: SimpleXMLElement, GZip, Gd, Imagemagick.
- Can use inkscape to export some image formats.

Is in development.

Code example:
-------------

[](#code-example)

```
require_once "svglib.php";

$svg = SVGDocument::getInstance( 'resource/apple.svg' ); //open to edit

//$svg = SVGDocument::getInstance( ); //default read to use

$rect = #create a new rect with, x and y position, id, width and heigth, and the style

$rect = SVGRect::getInstance( 0, 5, 'myRect', 228, 185, new SVGStyle( array( 'fill'   => 'red', 'stroke' => 'blue' ) ) );

$svg->addShape( $rect );

$text = SVGText::getInstance( 22, 50, 'myText', 'This is a text', $style );

$svg->asXML('output/output.svg'); //output to svg file

$svg->export('output/output.png'); //export as png

$svg->export('output/thumb32x32.png',32,32); //export thumbnail

$svg->output(); //echo with header to browser

?>
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

3105d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3585404?v=4)[Nikola Plavšić](/maintainers/nikolaplavsic)[@nikolaplavsic](https://github.com/nikolaplavsic)

---

Top Contributors

[![dampfklon](https://avatars.githubusercontent.com/u/1733625?v=4)](https://github.com/dampfklon "dampfklon (11 commits)")[![trialforce](https://avatars.githubusercontent.com/u/18430765?v=4)](https://github.com/trialforce "trialforce (2 commits)")

---

Tags

phpsvg

### Embed Badge

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

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

###  Alternatives

[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

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

A minimal yet powerful package to help you in development.

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

PHPackages © 2026

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