PHPackages                             jameslevi/sprite - 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. jameslevi/sprite

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

jameslevi/sprite
================

Is a simple image to sprite compiler tool for web development.

v1.0.9(5y ago)222MITPHPPHP &gt;=5.2.0

Since Mar 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jameslevi/sprite)[ Packagist](https://packagist.org/packages/jameslevi/sprite)[ Docs](https://github.com/jameslevi/sprite)[ RSS](/packages/jameslevi-sprite/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (0)

Sprite
======

[](#sprite)

[![](https://camo.githubusercontent.com/aeffdafb1bdad20a139f003b82d09ba22a66e6fb4fbc1bebd3d90b3d412c5feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d76312e302e392d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d2533434c4f474f5f4e414d45253345266c6f676f436f6c6f723d776869746526636f6c6f723d326262633861)](https://camo.githubusercontent.com/aeffdafb1bdad20a139f003b82d09ba22a66e6fb4fbc1bebd3d90b3d412c5feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d76312e302e392d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d2533434c4f474f5f4e414d45253345266c6f676f436f6c6f723d776869746526636f6c6f723d326262633861) [![](https://camo.githubusercontent.com/b4344b50cc4d00bc34f5209dfc527e7180da7c06507ab149bddbe79d0313e021/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d2533434c4f474f5f4e414d45253345266c6f676f436f6c6f723d776869746526636f6c6f723d326262633861)](https://camo.githubusercontent.com/b4344b50cc4d00bc34f5209dfc527e7180da7c06507ab149bddbe79d0313e021/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d2533434c4f474f5f4e414d45253345266c6f676f436f6c6f723d776869746526636f6c6f723d326262633861)

Is a simple image to sprite compiler tool for web development.

Features
--------

[](#features)

1. Supports png, gif, jpg, bmp and webp icons.
2. Automatically generate css class for each icon.
3. Easy integration with any web projects.

Installation
------------

[](#installation)

1. You can install via composer.

```
composer require jameslevi/sprite --dev

```

2. Copy the atmos file from vendor/jameslevi/atmos folder to your root directory.
3. Create a new folder in your root directory named commands.

Getting Started
---------------

[](#getting-started)

1. Create a new atmos command file named "sprite".

```
php atmos --make sprite

```

2. Open the Sprite.php file from commands folder and add a new protected method named "generate".

```
/**
 * Method to generate sprite image and stylesheet.
 *
 * @param  array $arguments
 * @return void
 */

protected function generate(array $arguments)
{

}
```

3. Try the following code inside the generate method.

```
// Create new instance by setting sprite name and asset location.
$sprite = new Sprite("test", __DIR__ . "/../resources/icons");

// Set where to save the generated sprite image.
$sprite->setGeneratedImagePath(__DIR__ . "/../public/img");
$sprite->setImageBaseURL("/../img");

// Set where to save the generated css file.
$sprite->setGeneratedCSSPath(__DIR__ . "/../public/css");

$sprite->generate();
```

4. Run the following command in your terminal to generate sprite.

```
php atmos sprite:generate

```

5. Add the generated css file in the head section of your project.

```
>

```

6. You can access each icon using css classes in this pattern *sprite-{sprite name}-{icon name}*.

```
>

```

7. If there is a need to add new icons into your icon set, just run the generate command and it will generate new sprite image and stylesheet again.

Best Practices
--------------

[](#best-practices)

1. In each sprite set, always make sure all icons are of the same type and dimensions.
2. Do not add spaces in naming icons, instead use hypen to separate words.
3. Do not place your assets folder in public directory.

Contribution
------------

[](#contribution)

For bug reports and suggestions, you can email James Levi Crisostomo via .

License
-------

[](#license)

This package is an open-sourced software licensed under [MIT](https://opensource.org/licenses/MIT) License.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~2 days

Total

12

Last Release

1850d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/457281?v=4)[Mario](/maintainers/voyager)[@voyager](https://github.com/voyager)

---

Top Contributors

[![jameslevi](https://avatars.githubusercontent.com/u/50510108?v=4)](https://github.com/jameslevi "jameslevi (69 commits)")

---

Tags

iconsspriteiconssprite

### Embed Badge

![Health badge](/badges/jameslevi-sprite/health.svg)

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

###  Alternatives

[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4869.0k](/packages/jkphl-iconizr)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[imagekit/imagekit

PHP library for Imagekit

47795.6k9](/packages/imagekit-imagekit)[contao/image

Contao image library

131.7M9](/packages/contao-image)[mostafaznv/nova-video

Video Field for Laravel Nova

22398.0k1](/packages/mostafaznv-nova-video)

PHPackages © 2026

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