PHPackages                             snappyimg/snappyimg-php - 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. snappyimg/snappyimg-php

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

snappyimg/snappyimg-php
=======================

Scale, crop and optimize images on-the-fly,

v1.0(7y ago)4232[2 PRs](https://github.com/snappyimg/snappyimg-php/pulls)MITPHP

Since Sep 20Pushed 6y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

[![](./logo.png)](./logo.png)

[![Build Status](https://camo.githubusercontent.com/f8e8e59c8f8f50d8f84dfb10c558f001db5f515c216b96f4f826086e621499ac/68747470733a2f2f7472617669732d63692e6f72672f736e61707079696d672f736e61707079696d672d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/snappyimg/snappyimg-php)

This is a PHP implementation of Snappyimg URL builder. For more information about the service, go to .

### Installation

[](#installation)

This library is available as [Composer package](https://packagist.org/packages/snappyimg/snappyimg-php):

```
$ composer require snappyimg/snappyimg-php
```

### Demo

[](#demo)

Processed original image `https://www.snappyimg.com/demo.jpg`into 640×360: `https://serve.snappyimg.com/snappyimg/pvvJK7Di3E1Fjetx9viameQMNo0LjHcM2rUh8v10En0/fit/640/360/ce/1/aHR0cHM6Ly93d3cuc25hcHB5aW1nLmNvbS9kZW1vLmpwZw.jpg`

[![](https://camo.githubusercontent.com/2504420df7c1dc7a1edf1f6e5299274222a38491c3344554ccb88086cd70aa23/68747470733a2f2f73657276652e736e61707079696d672e636f6d2f736e61707079696d672f7076764a4b374469334531466a657478397669616d65514d4e6f304c6a48634d3272556838763130456e302f6669742f3634302f3336302f63652f312f6148523063484d364c7939336433637563323568634842356157316e4c6d4e766253396b5a5731764c6d70775a772e6a7067)](https://camo.githubusercontent.com/2504420df7c1dc7a1edf1f6e5299274222a38491c3344554ccb88086cd70aa23/68747470733a2f2f73657276652e736e61707079696d672e636f6d2f736e61707079696d672f7076764a4b374469334531466a657478397669616d65514d4e6f304c6a48634d3272556838763130456e302f6669742f3634302f3336302f63652f312f6148523063484d364c7939336433637563323568634842356157316e4c6d4e766253396b5a5731764c6d70775a772e6a7067)

### Example usage

[](#example-usage)

```
$snappy = new Snappyimg($appToken, $appSecret, Snappyimg::STAGE_DEMO);

$options = Options::fromDefaults(360, 420);
$url = $snappy->buildUrl($options, 'https://www.snappyimg.com/demo.jpg');
```

Where `$appToken` and `$appSecret` are generated for you when you register at [snappyimg.com](https://www.snappyimg.com/).

```

```

While `STAGE_DEMO` is available for free for all users, you will need a [subscription](https://www.snappyimg.com/pricing) to use `STAGE_SERVE`.

### Additional options

[](#additional-options)

The `Options` class lets you specify exactly how the image should be processed.

```
$options = Options::fromDefaults(360, 420)
    ->setResize(Snappyimg::RESIZE_FIT)
    ->setGravity(Snappyimg::GRAVITY_SMART)
    ->setEnlarge(FALSE)
    ->setFormat(Snappyimg::FORMAT_WEBP);
```

The options themselves are explained at [Documentation](https://www.snappyimg.com/docs) and at each method.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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

2794d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/474f4dd92229f3cfd2c618004b250e2a96ca31f4114c2a0f9c8fb66c65ed7764?d=identicon)[Mikulas](/maintainers/Mikulas)

---

Top Contributors

[![Mikulas](https://avatars.githubusercontent.com/u/192200?v=4)](https://github.com/Mikulas "Mikulas (10 commits)")[![radekbernatek](https://avatars.githubusercontent.com/u/3998427?v=4)](https://github.com/radekbernatek "radekbernatek (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/snappyimg-snappyimg-php/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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