PHPackages                             visualweber/image-workshop - 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. visualweber/image-workshop

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

visualweber/image-workshop
==========================

Powerful PHP class using GD library to work easily with images including layer notion (like Photoshop or GIMP)

041PHP

Since Aug 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/visualweber/image-workshop)[ Packagist](https://packagist.org/packages/visualweber/image-workshop)[ RSS](/packages/visualweber-image-workshop/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

================================
================================

[](#)

ImageWorkshop class
===================

[](#imageworkshop-class)

================================
================================

[](#-1)

[![Test status](https://camo.githubusercontent.com/4c63ff378f10cf3f51f88683e4c3cc64a4e6d1f2675452fbbe6451492f1476e1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f537962696f2f496d616765576f726b73686f702e706e67)](https://camo.githubusercontent.com/4c63ff378f10cf3f51f88683e4c3cc64a4e6d1f2675452fbbe6451492f1476e1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f537962696f2f496d616765576f726b73686f702e706e67)

### Summary and features

[](#summary-and-features)

Really flexible and easy-to-use PHP class to work with images using the GD Library

### Latest updates

[](#latest-updates)

**Version 2.0.9 - 2015-07-05**

- Fix ImageWorkshop::initFromPath with remote URL

**Version 2.0.8 - 2015-06-01**

- Fix exception code when file not found

**Version 2.0.7 - 2015-03-22**

- Allow `ImageWorkshop::initFromPath` factory working with remote URL
- Improve PHP &gt;= 5.5 compatibility
- Add `fixOrientation` method to layer to change image orientation based on EXIF orientation data
- Fix background color when value is setting to "000000"

**Version 2.0.6 - 2014-08-01**

@jasny () contribution, new methods :

- `ImageWorkshopLayer::resizeToFit()` resizes an image to fit a bounding box.
- `ImageWorkshopLayer::cropToAspectRatio()` crops either to width or height of the document to match the aspect ratio.

Documentation here : [Sybio/ImageWorkshop#37 (comment)](https://github.com/Sybio/ImageWorkshop/pull/37#issue-28704248)

**Version 2.0.5 - 2013-11-12**

- Implementing interlace mode () on save() method to display progessive JPEG image

```
    $interlace = true; // set true to enable interlace, false by default
    $layer->save($dirPath, $filename, $createFolders, $backgroundColor, $imageQuality, $interlace);
```

Thanks @dripolles () &amp; @johnhunt ()

**Version 2.0.4 - 2013-09-11**

- Fix a major bug when resizing both sides AND conserving proportion : layer stack problem (current layer has a new nested level in its stack, not expected), and translations with positionX and positionY are wrong. Fixed. (Initial problem : [Sybio/ImageWorkshop#14](https://github.com/Sybio/ImageWorkshop/pull/14))
- Add a parameter to clearStack() method

**Version 2.0.2 - 2013-06-14**

- Fix a new bug : when resizing or cropping, small images can have 0 pixel of width or height (because of round), which is impossible and script crashes. Now width and height are 1 pixel minimum.

Note:

```
$layer->resizeInPixel(null, 0 /* or negative number */, null);
```

It will generate a 1 pixel height image, not 0.

**Version 2.0.1 - 2013-06-03**

- Fix an opacity bug : pure black color (#000000) always displayed fully transparent (from 0 to 99% opacity). Bug fixed ! (no known bug anymore)
- Add some Exceptions to help debugging

**Version 2.0.0 - 2012-11-21**

New version of ImageWorkshop ! The library is now divided in 3 main classes for cleaned code:

- ImageWorkshopLayer: the class which represents a layer, that you manipulate
- ImageWorkshop: a factory that is used to generate layers
- ImageWorkshopLib: a class containing some tools (for calculations, etc...), used by both classes

Technically, only the initialization change compared with the 1.3.x versions, check the documentation:

Here an example, before and now:

```
    // before
    $layer = new ImageWorkshop(array(
        'imageFromPath' => '/path/to/images/picture.jpg',
    ));
```

```
    // now
    $layer = ImageWorkshop::initFromPath('/path/to/images/picture.jpg');
```

And also the installation of the class:

The documentation has been updated, you can now check the documentation of each version since 1.3.3: (Ex: , )

### Installation

[](#installation)

The class is designed for PHP 5.3+, but it can work with older PHP versions... Check how to install the class here:

### Usage

[](#usage)

- Learn how to use the class in 5 minutes:
- The complete documentation:
- Usefull tutorials:

**What's new in the doc' ?**

- Installation guide:
- Adding the flip documentation:
- Adding the opacity documentation which was omitted:
- Tutorial "Manage animated GIF with ImageWorkshop (and GiFFrameExtractor &amp; GifCreator)":

### @todo

[](#todo)

- Adding a method to add easily borders to a layer (external, inside and middle border)
- Check given hexa' color and remove # if exists.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![vswb](https://avatars.githubusercontent.com/u/12278864?v=4)](https://github.com/vswb "vswb (1 commits)")

### Embed Badge

![Health badge](/badges/visualweber-image-workshop/health.svg)

```
[![Health](https://phpackages.com/badges/visualweber-image-workshop/health.svg)](https://phpackages.com/packages/visualweber-image-workshop)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

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