PHPackages                             joby/smol-image - 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. joby/smol-image

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

joby/smol-image
===============

A tightly-focused image manipulation library that eschews kitchen-sink approaches in favor of simple API and broader driver support.

v1.3.1(2mo ago)0104↓65%1MITPHPPHP &gt;=8.1CI passing

Since Mar 24Pushed 2mo agoCompare

[ Source](https://github.com/joby-lol/smol-image)[ Packagist](https://packagist.org/packages/joby/smol-image)[ RSS](/packages/joby-smol-image/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (1)

smolImage
=========

[](#smolimage)

A lightweight and minimalist no-dependency image transformation library for PHP 8.1+.

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

[](#installation)

```
composer require joby-lol/smol-image
```

About
-----

[](#about)

smolImage eschews kitchen-sink image libraries in favor of focusing on sizing and converting. It resizes, fits, and crops images using whatever backend your server provides. It is deliberately as self-contained as possible — no Composer dependencies, just PHP and the image transformation extensions or CLI tools you already have.

Basic Usage
-----------

[](#basic-usage)

```
use Joby\Smol\Image\SmolImage;

// Resize and save
SmolImage::load('/path/to/source.jpg')
    ->cover(800, 600)
    ->save('/path/to/output.webp');

// Or get the result as a string
$data = SmolImage::load('/path/to/source.jpg')
    ->fit(400, 300)
    ->jpeg()
    ->string();
```

Sizing
------

[](#sizing)

```
// Scale and crop to exactly fill the given dimensions (upscales if necessary)
$resized = $image->cover($width, $height);

// Scale to fit within the given bounding box (upscales if necessary)
$resized = $image->fit($width, $height);

// Scale only on one dimension (upscales if necessary)
$resized = $image->fit($width, null);
$resized = $image->fit(null, $height);

// No transformation — output at original size
$original = $image->original();
```

Output Format and Quality
-------------------------

[](#output-format-and-quality)

Default output format is WebP at quality 85. These can be changed globally or per image:

```
// Global defaults
SmolImage::setFormat(Format::jpeg);
SmolImage::setQuality(90);

// Per image — returns a new immutable instance
$image->jpeg();
$image->webp();
$image->png();
$image->quality(90);
```

Quality is on a scale of 0–100 and is interpreted appropriately per format. PNG compression is derived from this value automatically.

Blurring
--------

[](#blurring)

```
// Blur by a factor of 80/10
$image->blur();

// Blur by a factor of 50/100
$image->blur(50);

// Restore to zero blurring
$image->blur(0);
```

Blurring is on a somewhat arbitrary scale of 0-100 and is interpreted differently by different drivers.

Drivers
-------

[](#drivers)

smolImage defaults to using GD as its backend, because this is available most widely. There are also options to use Imagick or Unix command-line `convert` calls.

```
use Joby\Smol\Image\Drivers\GdDriver;
use Joby\Smol\Image\Drivers\ImagickDriver;
use Joby\Smol\Image\Drivers\CliConvertDriver;

SmolImage::setDriver(new ImagickDriver());        // requires ext-imagick
SmolImage::setDriver(new GdDriver());             // requires ext-gd (default)
SmolImage::setDriver(new CliConvertDriver());     // requires `convert` CLI
```

`CliConvertDriver` accepts an optional path to the `convert` executable:

```
SmolImage::setDriver(new CliConvertDriver('/usr/local/bin/convert'));
```

The `Image` object is immutable — all transformation methods return a new instance, making it safe to reuse a base image for multiple outputs:

```
$source = SmolImage::load('/path/to/photo.jpg')->webp();

$source->cover(1200, 630)->save('/path/to/cover.webp');
$source->cover(400, 400)->save('/path/to/thumb.webp');
$source->fit(1600, 1200)->save('/path/to/full.webp');
```

Requirements
------------

[](#requirements)

Fully tested on PHP 8.3+, static analysis for PHP 8.1+. Requires at least one of: `ext-gd`, `ext-imagick`, or ImageMagick's `convert` CLI tool with `exec()` enabled.

License
-------

[](#license)

MIT License - See [LICENSE](LICENSE) file for details.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance84

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

5

Last Release

84d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4e606aa41ebfd7d82c365c6dc4ec158fb1b0bfff5f8dcbfad4ab53e3092e6a6?d=identicon)[jobyone](/maintainers/jobyone)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/joby-smol-image/health.svg)

```
[![Health](https://phpackages.com/badges/joby-smol-image/health.svg)](https://phpackages.com/packages/joby-smol-image)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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