PHPackages                             danack/imagick-demos - 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. danack/imagick-demos

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

danack/imagick-demos
====================

1321637[47 issues](https://github.com/Imagick/ImagickDemos/issues)[2 PRs](https://github.com/Imagick/ImagickDemos/pulls)PHP

Since Oct 8Pushed 1y ago12 watchersCompare

[ Source](https://github.com/Imagick/ImagickDemos)[ Packagist](https://packagist.org/packages/danack/imagick-demos)[ RSS](/packages/danack-imagick-demos/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Imagick-demos
-------------

[](#imagick-demos)

An example of all the Imagick functions. Or at least most of them. The site is hosted at

The site uses Docker. If you have that on your system, you should be able to run the site locally with:

```
sh runLocal.sh

```

The site will be available at the domains:

 - default version of ImageMagick (currently 7).

 - explicitly use ImageMagick 6

 - explicitly use ImageMagick 7

It will take a few minutes (or more) to come up, as it has to compile ImageMagick 6 and 7, and then Imagick. After the first run, these are cached, so should only take a few seconds.

The site is built against the master branch of Imagick at  . As it takes a long time, by default it doesn't rebuild from scratch each time. To force a rebuild against the latest version of Imagick

```
runRebuildLocal.sh

```

containers/imagick\_php\_base\_im7/install\_imagemagick.sh containers/imagick\_php\_base\_im6/install\_imagemagick.sh

Adding examples
---------------

[](#adding-examples)

There is a list of which examples still need to be added at [phpimagick.com/todo](https://phpimagick.com/todo).

Here are some instructions on adding examples.

### Text example

[](#text-example)

A text example, is an example that has text as it's output, rather than an image. A complete example for Imagick::getImageMimeType [was added in this commit](https://github.com/Imagick/ImagickDemos/commit/9df6cef1051ab6fa90d1bf834a23d083bdf5ab79).

The steps involved are:

1. Add the example to appropriate list in src/example\_list.php

All of the examples are listed in one of getImagickExamples(), getImagickDrawExamples(), getImagickKernelExamples(), getImagickPixelExamples(), getImagickPixelIteratorExamples(), getTutorialExamples().

For each entry in the array, the key is the example name and value is the example controller and example function name. Although most of the time these are the same some examples re-use a controller + function, as there isn't much point duplicating code. e.g. for ImagickDraw 'popClipPath' =&gt; 'setClipPath',

2. Create a controller

The controller should be in one of the Imagick, ImagickDraw, ImagickKernel, ImagickPixel, ImagickPixelIterator or Tutorial directories under src/ImagickDemo

Usually copying an existing one is a good idea.

The render method of the controller should return a string that demonstrates the result of using the function.

3. Mark the example code with a comment with the exact spelling like:

```
//Example Imagick::getImageMimeType
    $imagick = new \Imagick($this->imageControl->getImagePath());

    $output = 'Imagick::getImageMimeType result is: ';
    $output .= $imagick->getImageMimeType();

    return $output;
//Example end

```

This makes the example code be picked up and shown on the webpage.

### Standard image example

[](#standard-image-example)

A standard image example, is an example that has an image as it's output, where the image is produced by a single simple function. A complete example for Imagick::swirlImageWithMethod [was added in this commit](https://github.com/Imagick/ImagickDemos/commit/e8fe53b5934560779b2b6e0c7404d50aafc39298).

The steps involved are:

1. Add the example to appropriate list in src/example\_list.php

All of the examples are listed in one of getImagickExamples(), getImagickDrawExamples(), getImagickKernelExamples(), getImagickPixelExamples(), getImagickPixelIteratorExamples(), getTutorialExamples().

For each entry in the array, the key is the example name and value is the example controller and example function name. Although most of the time these are the same some examples re-use a controller + function, as there isn't much point duplicating code. e.g. for ImagickDraw 'popClipPath' =&gt; 'setClipPath',

2. Create a controller

Usually copying an existing one is a good idea.

```
class swirlImageWithMethod extends \ImagickDemo\Example
{
    public function renderTitle(): string
    {
        return "Imagick::swirlImageWithMethod";
    }

    public function useImageControlAsOriginalImage()
    {
        return true;
    }

    public static function getParamType(): string
    {
        return SwirlImageWithMethodControl::class;
    }
}

```

If the image produced is the same size as the source image, then overloading the useImageControlAsOriginalImage method to return true, will make it possible to hover over the final/original image to compare the two.

3. Add example code to `src/ImagickDemo/Imagick/functions.php`

The name of the function should be the same name as the controller.

```
//Example Imagick::swirlImageWithMethod
function swirlImageWithMethod($image_path, $swirl, int $interpolate_method)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->swirlImageWithMethod($swirl, $interpolate_method);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}
//Example end

```

4. If necessary create a new example control class.

The getControlType method of the controller, says which control to use.

```
class SwirlImageWithMethodControl
{
    use SafeAccess;
    use CreateFromVarMap;
    use ToArray;
    use InputParameterListFromAttributes;

    public function __construct(
        #[Swirl('swirl')]
        private string $swirl,
        #[InterpolateType('interpolate_method')]
        private int $interpolate_method,
        #[Image('image_path')]
        private string $image_path,
    ) {
    }

    public function getValuesForForm(): array
    {
        return [
            'swirl' => $this->swirl,
            'interpolate_method' => getOptionFromOptions($this->interpolate_method, getInterpolateOptions()),
            'image_path' => getOptionFromOptions($this->image_path, getImagePathOptions()),
        ];
    }
}

```

The keys in the array returned by `SwirlImageWithMethodControl::getValuesForForm` should match the parameter names for the function that produces the image.

### Bespoke image example

[](#bespoke-image-example)

TODO - write words...

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 99.8% 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/9db967c6005625e444a502fb830a30669b9fed53bfbc67e81a054508c0975a6b?d=identicon)[Danack](/maintainers/Danack)

---

Top Contributors

[![Danack](https://avatars.githubusercontent.com/u/1505719?v=4)](https://github.com/Danack "Danack (615 commits)")[![vanderlee](https://avatars.githubusercontent.com/u/649240?v=4)](https://github.com/vanderlee "vanderlee (1 commits)")

### Embed Badge

![Health badge](/badges/danack-imagick-demos/health.svg)

```
[![Health](https://phpackages.com/badges/danack-imagick-demos/health.svg)](https://phpackages.com/packages/danack-imagick-demos)
```

###  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)
