PHPackages                             dneustadt/average-color-matrix - 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. dneustadt/average-color-matrix

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

dneustadt/average-color-matrix
==============================

Generates a matrix in desired resolution of average colors of an image

1.0.0(8y ago)110MITPHP

Since Jan 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dneustadt/average-color-matrix)[ Packagist](https://packagist.org/packages/dneustadt/average-color-matrix)[ Docs](https://davidneustadt.de)[ RSS](/packages/dneustadt-average-color-matrix/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

AverageColorMatrix
==================

[](#averagecolormatrix)

Generates a matrix in desired resolution of average colors of an image. Can also output result as SVG Markup.

Demo
----

[](#demo)

[See here](https://htmlpreview.github.io/?https://github.com/dneustadt/average-color-matrix/blob/master/demo/demo.html)

Usage
-----

[](#usage)

Create an Instance of `AverageColorMatrix` passing the absolute path to the image.

Call `get` method of said instance with the x, y resolution. The third argument expects a boolean (default: `false`). If `true` the output will be SVG markup.

Returns a nested array of rows and columns with RGB and hex values. Alternatively returns SVG markup ready to use.

Example
-------

[](#example)

```
$matrix = new \AverageColorMatrix\AverageColorMatrix(
    __DIR__ .  DIRECTORY_SEPARATOR . $filename
);

$matrix->get(4, 4);
```

Result:

```
array(3) {
  ["y_percent"]=>
  float(25)
  ["x_percent"]=>
  float(25)
  ["tiles"]=>
  array(4) {
    [0]=>
    array(4) {
      [0]=>
      array(4) {
        ["r"]=>
        int(214)
        ["g"]=>
        int(215)
        ["b"]=>
        int(220)
        ["hex"]=>
        string(7) "#d6d7dc"
      }
      [...]
    }
    [...]
  }
}

```

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3037d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69c1745bd6023c706f651e9bdb38515fc7678caf52b9580126141381168669cd?d=identicon)[dneustadt](/maintainers/dneustadt)

---

Top Contributors

[![dneustadt](https://avatars.githubusercontent.com/u/9033214?v=4)](https://github.com/dneustadt "dneustadt (8 commits)")

---

Tags

averagecolorsheximagematrixrgbsvgimagergbsvgmatrixhexcolorsaverage

### Embed Badge

![Health badge](/badges/dneustadt-average-color-matrix/health.svg)

```
[![Health](https://phpackages.com/badges/dneustadt-average-color-matrix/health.svg)](https://phpackages.com/packages/dneustadt-average-color-matrix)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[spatie/image

Manipulate images with an expressive API

1.4k54.4M137](/packages/spatie-image)[picqer/php-barcode-generator

An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.

1.8k25.5M87](/packages/picqer-php-barcode-generator)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)

PHPackages © 2026

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