PHPackages                             davidvinicius/imagetrix - 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. davidvinicius/imagetrix

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

davidvinicius/imagetrix
=======================

A short library to convert images in matrix.

1.0.0(6y ago)03MITPHPPHP ^7.0

Since Mar 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/DavidVinicius/imagetrix)[ Packagist](https://packagist.org/packages/davidvinicius/imagetrix)[ RSS](/packages/davidvinicius-imagetrix/feed)WikiDiscussions master Synced 5d ago

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

Imagetrix
=========

[](#imagetrix)

Imagetrix is a little and very simple library to convert Images to Matrix.

### Install

[](#install)

```
composer require davidvinicius/imagetrix
```

### Examples

[](#examples)

Image 1 [![alt text](https://raw.githubusercontent.com/DavidVinicius/imagetrix/master/image.png "Image of example. Smile")](https://raw.githubusercontent.com/DavidVinicius/imagetrix/master/image.png)

Image 2: [![alt text](https://raw.githubusercontent.com/DavidVinicius/imagetrix/master/image2.png "Image of example 2. A little circle.")](https://raw.githubusercontent.com/DavidVinicius/imagetrix/master/image2.png)

Converting the image 2 to matrix.

```
use Imagetrix\Imagetrix

Imagetrix::toBinaryMatrix("path/image")

//output
[
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
  [1, 1, 1, 0, 0, 0, 0, 1, 1, 1],
  [1, 1, 0, 0, 0, 0, 0, 0, 1, 1],
  [1, 0, 0, 0, 1, 1, 0, 0, 0, 1],
  [1, 0, 0, 0, 1, 1, 0, 0, 0, 1],
  [1, 0, 0, 0, 1, 1, 0, 0, 0, 1],
  [1, 1, 0, 0, 0, 0, 0, 0, 1, 1],
  [1, 1, 1, 0, 0, 0, 0, 1, 1, 1],
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
]
```

Converting the the image 2 to vector.

```
use Imagetrix\Imagetrix

Imagetrix::toBinaryVector("path/image")

//output
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
```

You can use other methods like:

```
Imagetrix::toMatrix("path/image");
Imagetrix::toMatrixRGB("path/image");
```

Drawing the image 1 as string:

```
use Imagetrix\Imagetrix

Imagetrix::draw("path/image", 40, 30) // cols and rows.

//output
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000011111111111110000000000000
0000000000011111111111111111110000000000
0000000001111111111111111111111100000000
0000000011111111111111111111111110000000
0000001111111111111111111111111111000000
0000011111111111111111111111111111110000
0000111111111111111111111111111111110000
0000111111111111111111111111111111111000
0001111111110111111111111111111111111100
0001111111110011111110011111111111111100
0011111111100011111100011111111111111100
0011111111100111111100111111111111111110
0011111111111111111111111111111111111110
0011111111111111111111111111111111111110
0011111111111111111111111111111111111110
0011110111111111111111111111110111111110
0011110111111111111111111111110011111100
0001111011111111111111111111111111111100
0001111101111111111111111111111111111100
0000111111111111111111111110111111111000
0000011111101111111111111111111111110000
0000001111111101111111101111111111100000
0000000111111111111111111111111111000000
0000000011111111111111111111111110000000
0000000001111111111111111111111000000000
0000000000001111111111111111100000000000
0000000000000001111111111100000000000000
0000000000000000000000000000000000000000
```

### Licence

[](#licence)

Imagetrix is a open-sourced software licensed under the MIT license.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec13bfb97a686b6911e8111916929c5fd7704f04c9ec44aa7a818daa19ecad23?d=identicon)[David Vinicius](/maintainers/David%20Vinicius)

---

Top Contributors

[![DavidVinicius](https://avatars.githubusercontent.com/u/18719634?v=4)](https://github.com/DavidVinicius "DavidVinicius (13 commits)")

---

Tags

convertimagevectormatrix

### Embed Badge

![Health badge](/badges/davidvinicius-imagetrix/health.svg)

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

###  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)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k38.3M217](/packages/liip-imagine-bundle)[spatie/image

Manipulate images with an expressive API

1.4k54.4M138](/packages/spatie-image)[h4cc/wkhtmltoimage-amd64

Convert html to image using webkit (qtwebkit). Static linked linux binary for amd64 systems.

20110.7M15](/packages/h4cc-wkhtmltoimage-amd64)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)

PHPackages © 2026

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