PHPackages                             rm/minisprite - 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. rm/minisprite

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

rm/minisprite
=============

MiniSprite CSS sprites generator

08PHP

Since May 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/romanmatyus/MiniSprite)[ Packagist](https://packagist.org/packages/rm/minisprite)[ RSS](/packages/rm-minisprite/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

MiniSprite
==========

[](#minisprite)

[![Build Status](https://camo.githubusercontent.com/66942533f5553e1468dbe044e0d84c8bb36c562b3ab4865de9d5652613b8f339/68747470733a2f2f7472617669732d63692e6f72672f726f6d616e6d61747975732f4d696e695370726974652e737667)](https://travis-ci.org/romanmatyus/MiniSprite)[![Code Quality](https://camo.githubusercontent.com/32d35f32c934c8fb920123aa2f723ebe767cb79330d0789a95fffef9cba98502/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726f6d616e6d61747975732f4d696e695370726974652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/romanmatyus/MiniSprite/)

MiniSprite is library for automatized generating CSS Sprites from CSS definitions.

\## Requirements

MiniSprite requires PHP 5.3.3 or later.

\## How does this work?

- Configure.
- Parse CSS input.
- Create Sprite image folding proposals.
- Select winner proposal.
- Generate Sprite images.
- Regenerate content of CSS input and return it.

\## Installation

The best way to install MiniSprite is use [Composer](http://doc.nette.org/composer) package [`rm/minisprite`](https://packagist.org/packages/rm/minisprite) or manual download the latest ZIP package from [GitHub](https://github.com/romanmatyus/MiniSprite/archive/master.zip).

The downloaded package includes the following directories:

- `src`: this directory contains the source code of MiniSprite. This is the only directory that you will need in order to deploy your application.
- `tests`: contains MiniSprite unit tests. Tests is too usable as examples od use case.

\## Getting started

```
namespace MiniSprite;

require __DIR__ . '/MiniSprite/vendor/autoload.php';

$miniSprite = new MiniSprite;

// Configuration of Minisprite.
$miniSprite->setImageDirSource("http://www.umb.sk"); // Base path for searching images in CSS content.
$miniSprite->setImageDirOutput("./"); // Directory for saving sprite images.
$miniSprite->setImageDirOutputCss("./"); // Relative path for link of sprite images in regenerated CSS content.

// Registration of folding algorithms.
$miniSprite->addFolder(new HorizontalFolder);
$miniSprite->addFolder(new VerticalFolder);

// Registration of analyzer for winner selection.
$miniSprite->setAnalyzer(new MinimalAreaAnalyzer);

// Call compilation.
// In the variable $newCSS is content of regenerated CSS input.
$newCss = $miniSprite->compile(file_get_contents("http://www.umb.sk/umb/umbbb.nsf/styl.css"));

```

\## Contributing

- Use it!
- Write bug reports of ideas into [Issue tracker](https://github.com/romanmatyus/MiniSprite/issues).
- Fork repos and send pull requests with number of issue, source code and tests.

\## Todo

- Find and solve bugs.
- Create new folding algorithms.
- Create online API.
- Propagate.

\## Contact

Roman Mátyus

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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/449a7c90ef6867e1933b546f9e309c7e68c5604067940a7e89c5bb8227f90830?d=identicon)[romanmatyus](/maintainers/romanmatyus)

---

Top Contributors

[![romanmatyus](https://avatars.githubusercontent.com/u/1110294?v=4)](https://github.com/romanmatyus "romanmatyus (20 commits)")

### Embed Badge

![Health badge](/badges/rm-minisprite/health.svg)

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

PHPackages © 2026

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