PHPackages                             forevermatt/mosaic - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. forevermatt/mosaic

ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

forevermatt/mosaic
==================

A set of PHP classes for assembling a mosaic, designed to look like a given guide image, using a set of source images.

0.5.2(7y ago)221MITPHPCI failing

Since Nov 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/forevermatt/mosaic)[ Packagist](https://packagist.org/packages/forevermatt/mosaic)[ RSS](/packages/forevermatt-mosaic/feed)WikiDiscussions develop Synced 4w ago

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

ARCHIVED - This repo is no longer maintained
============================================

[](#archived---this-repo-is-no-longer-maintained)

---

Mosaic Maker
============

[](#mosaic-maker)

A set of PHP classes for assembling a mosaic, designed to look like a given guide image, using a set of source images.

Usage
-----

[](#usage)

Pick a directory where the temp folder (used for caching source image data) can be kept. Open a command prompt in that folder, and run the following:

```
php

```

Replace the values in angle brackets with actual paths. For example, replace `` with something like `"C:\code\mosaic\cli.php"`(depending on where you cloned this repo to on your computer). Note that any additional command-line parameters are treated as additional folders containing source images to be used for generating the mosaic.

**The first time you run this**, it will probably take quite some time since it has not yet cached downsized copies of your source images (and therefor it has to do a lot of image resizing). The next (and subsequent) times should be much faster.

Basic Approach
--------------

[](#basic-approach)

A. Get guide image. B. Get source images. C. Slice up guide image. D. Match up each slice of the guide image with a different source image. E. Assemble and save mosaic.

---

C.1. Count source images. 2. Slice guide image into no more than that many slices.

---

D.1. Downsize the slice to 3 pixels by 3 pixels. Record the RGB values of the pixels. 2. Compare that with each of the source images. 3. Make a note of which unused source image matches this slice best.

---

D.2.a. Downsize the source image to 3 pixels by 3 pixels. Record the RGB values of the pixels. b. Calculate the absolute difference of slice's pixels' colors with this source image's pixels' colors.

---

E.1. Create a new empty image. 2. Insert each of the source images according to the matches found.

---

Match accuracy (at a given resolution) = D\[1\] + D\[2\] + ... + D\[number of pixels\]

D = abs(R\[a\] - R\[b\]) + abs(G\[a\] - G\[b\]) + abs(B\[a\] - B\[b\])

Only accuracy calculations at matching resolutions give a meaningful comparison.

Glossary
--------

[](#glossary)

- *guide image*: The image that the mosaic is trying to mimic.
- *slice* (aka. guide image slice): A portion of the original guide image.
- *source images*: The images being used to recreate the guide image as a mosaic.

License
-------

[](#license)

This software is under the MIT license.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance60

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~185 days

Recently: every ~320 days

Total

8

Last Release

2579d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/836739aa4f60c754dc9a4a547ebd0c166e4b6e855d9f119df2be5aec92f3a375?d=identicon)[forevermatt](/maintainers/forevermatt)

---

Top Contributors

[![forevermatt](https://avatars.githubusercontent.com/u/6233204?v=4)](https://github.com/forevermatt "forevermatt (130 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/forevermatt-mosaic/health.svg)

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

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

21115.5M166](/packages/drupal-drupal-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M130](/packages/wp-cli-wp-cli-tests)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

39250.0k28](/packages/ec-europa-toolkit)[drevops/behat-steps

Collection of steps for Behat

27409.9k4](/packages/drevops-behat-steps)

PHPackages © 2026

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