PHPackages                             gomdim-apps/slimmer - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. gomdim-apps/slimmer

ActiveLibrary[File &amp; Storage](/categories/file-storage)

gomdim-apps/slimmer
===================

PDF, image, and file compressor (Tar/Zstd) using Ghostscript and GD

v1.2.0(3w ago)823↑50%MITPHPPHP &gt;=8.2CI passing

Since May 16Pushed 3w agoCompare

[ Source](https://github.com/GomdimApps/Slimmer)[ Packagist](https://packagist.org/packages/gomdim-apps/slimmer)[ RSS](/packages/gomdim-apps-slimmer/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

 [![Slimmer Logo](docs/_media/logo.png)](docs/_media/logo.png)

Slimmer
=======

[](#slimmer)

> Advanced file compression for PHP — PDF · Images · Archives

A PHP library for compressing PDFs, images, and directories with minimal dependencies. Uses [Ghostscript](https://www.ghostscript.com/) for PDFs, PHP's `ext-gd` for images, and system `tar` for archives.

[![Packagist](https://camo.githubusercontent.com/213073d5c03e609c09b6fbb83a9b5df7236b5250d42d00f6b301f4d5258a5158/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6d64696d2d617070732f736c696d6d6572)](https://packagist.org/packages/gomdim-apps/slimmer)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Quick Start
-----------

[](#quick-start)

```
composer require gomdim-apps/slimmer
```

### PDF Optimization

[](#pdf-optimization)

```
use GomdimApps\Slimmer\Optimizers\PdfOptimizer;

$ratio = (new PdfOptimizer())
    ->withQuality('screen')
    ->optimize('input.pdf', 'output.pdf');
```

### Image Compression

[](#image-compression)

```
use GomdimApps\Slimmer\Optimizers\ImageOptimizer;

$ratio = (new ImageOptimizer())
    ->withQuality(75)
    ->optimize('input.jpg', 'output.jpg');
```

### Tar Archiving

[](#tar-archiving)

```
use GomdimApps\Slimmer\Optimizers\CompressTar;

$ratio = (new CompressTar())
    ->withFormat('zst')
    ->optimize('/path/to/dir', 'output.tar.zst');
```

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

[](#requirements)

- **PHP**: &gt;= 8.2
- **ext-gd**: For image compression
- **Ghostscript** (`gs`): For PDF optimization
- **tar**: For archiving
- **zstd** *(optional)*: For `.tar.zst` compression

Features
--------

[](#features)

- 📦 **PDF optimization** with quality presets
- 🖼️ **Image compression** (JPG, PNG)
- 📂 **Tar archiving** (`.tar.gz`, `.tar.zst`)
- 💾 **In-memory I/O** via `fromString()` / `fromStream()`
- 🔍 **Dry-run mode** for command inspection
- ⏱️ **Timeout control** to prevent runaway processes
- 🎯 **Retention management** for archives

Documentation
-------------

[](#documentation)

Full documentation is available at [**GomdimApps.github.io/Slimmer**](https://GomdimApps.github.io/Slimmer)

Key sections:

- [Installation &amp; Requirements](https://GomdimApps.github.io/Slimmer/#/installation)
- [PDF Optimizer](https://GomdimApps.github.io/Slimmer/#/pdf-optimizer)
- [Image Optimizer](https://GomdimApps.github.io/Slimmer/#/image-optimizer)
- [Tar Compression](https://GomdimApps.github.io/Slimmer/#/tar-compression)
- [Streams &amp; Buffers](https://GomdimApps.github.io/Slimmer/#/streams-buffers)
- [Error Handling](https://GomdimApps.github.io/Slimmer/#/error-handling)
- [Troubleshooting](https://GomdimApps.github.io/Slimmer/#/troubleshooting)

Docker Testing
--------------

[](#docker-testing)

Run the test suite in an isolated environment:

```
make test
```

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance95

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

24d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/716b7be447e7ec61c1953dffa035ec4f3dfd7f20706bbb728b2518e589aa0dfe?d=identicon)[GomdimApps](/maintainers/GomdimApps)

---

Top Contributors

[![GomdimApps](https://avatars.githubusercontent.com/u/81498379?v=4)](https://github.com/GomdimApps "GomdimApps (22 commits)")

---

Tags

compression-algorithmfast-compressionghostscriptgzipgzip-compressionimage-compressionoptimization-toolspdf-compressorpdf-optimizationphpzstd

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/gomdim-apps-slimmer/health.svg)

```
[![Health](https://phpackages.com/badges/gomdim-apps-slimmer/health.svg)](https://phpackages.com/packages/gomdim-apps-slimmer)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[illuminate/console

The Illuminate Console package.

13045.3M6.1k](/packages/illuminate-console)[illuminate/process

The Illuminate Process package.

44813.9k94](/packages/illuminate-process)[digifactory/laravel-pull-production-data

Pull your production storage folder and database to your local environment

1016.9k](/packages/digifactory-laravel-pull-production-data)[verseles/sevenzip

A package to compress and decompress files using 7zip

191.8k](/packages/verseles-sevenzip)

PHPackages © 2026

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