PHPackages                             treinetic/imageartist - 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. [Image &amp; Media](/categories/media)
4. /
5. treinetic/imageartist

ActiveLibrary[Image &amp; Media](/categories/media)

treinetic/imageartist
=====================

ImageArtist is a php gd Wrapper which makes Image manipulation insanely easy, we introduce ImageArtist as Photoshop for php

v2.1.0(4mo ago)8675.2k↓19.1%24[14 issues](https://github.com/Treinetic/ImageArtist/issues)[2 PRs](https://github.com/Treinetic/ImageArtist/pulls)MITPHPPHP ^8.2CI passing

Since Sep 8Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/Treinetic/ImageArtist)[ Packagist](https://packagist.org/packages/treinetic/imageartist)[ RSS](/packages/treinetic-imageartist/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (17)Used By (0)

[![ImageArtist Banner](./readme_banner.jpg)](./readme_banner.jpg)

Try out before you actually use it `docker run --pull always -p 9090:80 treineticprojects/demo_opensource:latest`

ImageArtist 2.0.0
=================

[](#imageartist-200)

ImageArtist is a modern PHP library for easy image manipulation using the GD extension. Think of it as a fluent, cleaner API for GD. It simplifies complex tasks like shapes, text overlays, and merging.

This project is an initiative of Treinetic (Pvt) Ltd, Sri Lanka.

[![Issues](https://camo.githubusercontent.com/fcafc4811a0fa65c77d8d16c19aa8a8d8e6098911deb47bf8a7283957ba19700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/fcafc4811a0fa65c77d8d16c19aa8a8d8e6098911deb47bf8a7283957ba19700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)[![Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Forks](https://camo.githubusercontent.com/6ab683b41716395267e47f7c77601351e633749e663a3a6c4dfd52bcc3282d14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6ab683b41716395267e47f7c77601351e633749e663a3a6c4dfd52bcc3282d14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)[![Stars](https://camo.githubusercontent.com/74d822412a49e458ac7a24710d90430a61c37261e90b86015a809e32ee08f162/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/74d822412a49e458ac7a24710d90430a61c37261e90b86015a809e32ee08f162/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f547265696e657469632f496d6167654172746973742e7376673f7374796c653d666c61742d737175617265)[![Twitter](https://camo.githubusercontent.com/4ab2e67338a362202075d1b67ea58c8f578e934c7df76f344147d695358bfd86/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f547265696e657469632f496d6167654172746973742e7376673f7374796c653d736f6369616c)](https://camo.githubusercontent.com/4ab2e67338a362202075d1b67ea58c8f578e934c7df76f344147d695358bfd86/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f547265696e657469632f496d6167654172746973742e7376673f7374796c653d736f6369616c)

Features
--------

[](#features)

FeatureDescription**Fluent API**Chained methods for intuitive image manipulation (`scale()->crop()->save()`).**Shapes**Built-in support for Triangles, Polygons, Circles, and Squares.**Text Overlays**Add multi-line text with custom fonts, colors, and positioning.**Layer System****New:** Non-destructive editing with stacks, opacity control, and visibility toggles.**Filters &amp; Effects****New:** Apply standard filters (Grayscale, Blur, Brightness) fluently.**Smart Merging**Merge multiple images, shapes, or overlays with alpha blending support.**Geometric Helpers**Easy coordinate and size calculations.**Zero Dependencies**Lightweight, relying primarily on the standard GD extension.Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- `ext-gd` extension

**Optional**:

- `ext-imagick` (Required for advanced features in future versions)

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

[](#installation)

### 1. System Dependencies

[](#1-system-dependencies)

This library requires the **GD Extension** enabled in your environment.

**Docker (Dockerfile)**

```
RUN docker-php-ext-install gd
```

**Ubuntu / Debian**

```
sudo apt-get install php-gd
```

**Alpine Linux**

```
apk add php-gd
```

### 2. Composer

[](#2-composer)

Install the package via composer:

```
composer require treinetic/imageartist
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

First, import the necessary classes. **Note**: The namespace has been streamlined to `Treinetic\ImageArtist`.

```
use Treinetic\ImageArtist\Image;

// Load an image
$image = new Image("./morning.jpeg");

// Scale to 40%
$image->scale(40);

// Resize to specific dimensions
$image->resize(1024, 768);

// Save or Output
$image->save("./newImage.jpg", IMAGETYPE_PNG);
```

### Shape &amp; Attributes

[](#shape--attributes)

Tip

**New:** Detailed documentation and examples for all shapes are available in only [docs/shapes.md](docs/shapes.md).

```
use Treinetic\ImageArtist\Image;
use Treinetic\ImageArtist\Shapes\Triangle;
use Treinetic\ImageArtist\Commons\Node;

// Create a Triangle from an image
$triangle = new Triangle("./city.jpg");
// ... rest of the example
```

```
$triangle->scale(60);
// Set points (Percentage or Pixels)
$triangle->setPointA(20, 20, true);
$triangle->setPointB(80, 20, true);
$triangle->setPointC(50, 80, true);
$triangle->build();

$triangle->save("./triangle.png", IMAGETYPE_PNG);
```

 [![](https://raw.githubusercontent.com/Treinetic/ImageArtist/images/img/triangle.png)](https://raw.githubusercontent.com/Treinetic/ImageArtist/images/img/triangle.png)

### Advanced Merging &amp; Overlays

[](#advanced-merging--overlays)

Tip

**New:** Detailed documentation for Text and Overlays is available in [docs/text.md](docs/text.md).

```
use Treinetic\ImageArtist\Image;
use Treinetic\ImageArtist\Overlays\Overlay;
use Treinetic\ImageArtist\Shapes\CircularShape;
use Treinetic\ImageArtist\Text\TextBox;
use Treinetic\ImageArtist\Text\Color;
use Treinetic\ImageArtist\Text\Font;

$img = new Image("./background.jpg");
// ... rest of the example
```

```
// Add an overlay
$overlay = new Overlay($img->getWidth(), $img->getHeight(), new Color(0, 0, 0, 80));
$img->merge($overlay, 0, 0);

// Add a circular profile picture
$circle = new CircularShape("./person.jpg");
$circle->build();
$img->merge($circle, ($img->getWidth() - $circle->getWidth()) / 2, ($img->getHeight() - $circle->getHeight()) / 2);

// Add Text
$textBox = new TextBox(310, 40);
$textBox->setColor(new Color(255, 255, 255)); // White
$textBox->setFont(Font::getFont(Font::$NOTOSERIF_REGULAR));
$textBox->setSize(20);
$textBox->setText("We Are Team Treinetic");

$img->setTextBox($textBox, ($img->getWidth() - $textBox->getWidth()) / 2, $img->getHeight() * (5/7));

// Output directly to browser (ImageArtist 1.0 style)
$img->dump();

// For modern usage, see new features:
// - [Layers System](docs/layers.md)
// - [Filters & Effects](docs/filters.md)
```

[![](https://raw.githubusercontent.com/Treinetic/ImageArtist/images/img/cover.png)](https://raw.githubusercontent.com/Treinetic/ImageArtist/images/img/cover.png)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Imal Hasaranga Perera](https://github.com/imalhasaranga)
- [Nuwan Chamara](https://github.com/nuwanchamara)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance74

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 88.1% 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 ~378 days

Recently: every ~755 days

Total

9

Last Release

147d ago

Major Versions

0.3.1 → 1.0.02017-09-24

1.0.1 → v2.1.02025-12-23

PHP version history (2 changes)0.1.0-alphaPHP &gt;=5.5.0

v2.1.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1076374?v=4)[Imal Hasaranga Perera](/maintainers/imalhasaranga)[@imalhasaranga](https://github.com/imalhasaranga)

---

Top Contributors

[![imalhasaranga](https://avatars.githubusercontent.com/u/1076374?v=4)](https://github.com/imalhasaranga "imalhasaranga (111 commits)")[![nuwanchamara](https://avatars.githubusercontent.com/u/9565807?v=4)](https://github.com/nuwanchamara "nuwanchamara (12 commits)")[![teiling88](https://avatars.githubusercontent.com/u/4624237?v=4)](https://github.com/teiling88 "teiling88 (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

scale imageimage mergeGD Made EasyPHP GD WrapperEasy GD WrapperImage Shape cropimage to base64write text on image

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/treinetic-imageartist/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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