PHPackages                             mathiasgrimm/laravel-cloud-binaries - 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. mathiasgrimm/laravel-cloud-binaries

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

mathiasgrimm/laravel-cloud-binaries
===================================

Pre-built static binaries for Laravel Cloud (jpegoptim, optipng, pngquant, cwebp, dwebp, avifenc, avifdec, gifsicle, ffmpeg, ffprobe, magick)

v1.1.0(3mo ago)112061[1 PRs](https://github.com/mathiasgrimm/laravel-cloud-binaries/pulls)MITDockerfileCI passing

Since Mar 19Pushed 3mo agoCompare

[ Source](https://github.com/mathiasgrimm/laravel-cloud-binaries)[ Packagist](https://packagist.org/packages/mathiasgrimm/laravel-cloud-binaries)[ RSS](/packages/mathiasgrimm-laravel-cloud-binaries/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

Laravel Cloud Binaries
======================

[](#laravel-cloud-binaries)

Pre-built, statically compiled binaries for Linux (amd64/musl). Designed to be installed as a Composer package so that `vendor/bin/` contains ready-to-use tools on Laravel Cloud (or any Linux environment).

This package includes all the binaries required by [spatie/image-optimizer](https://github.com/spatie/image-optimizer), making it a drop-in solution for image optimization on environments where system packages are not available. Note that [svgo](https://github.com/svg/svgo) is not included as it is a regular npm package and can be installed via `npm install -g svgo`.

Binaries included
-----------------

[](#binaries-included)

BinaryPurpose`jpegoptim`JPEG optimization`optipng`PNG optimization`pngquant`PNG lossy compression`cwebp`WebP encoding`dwebp`WebP decoding`avifenc`AVIF encoding`avifdec`AVIF decoding`gifsicle`GIF optimization`ffmpeg`Audio/video transcoding`ffprobe`Media stream analysis`magick`ImageMagick 7 (replaces convert/identify/mogrify)All binaries are statically linked against musl libc (Alpine Linux). They will **not** run on macOS — this is expected.

Pinned versions
---------------

[](#pinned-versions)

All upstream versions are defined at the top of the `Makefile` and passed to each Dockerfile via `--build-arg`. To bump a version, change the single variable in the Makefile.

BinaryVariableCurrent versionSizejpegoptim`JPEGOPTIM_VERSION``v1.5.6`1.0 MBoptipng`OPTIPNG_VERSION``0.7.8`797 KBpngquant`PNGQUANT_VERSION``3.0.3`1.3 MBcwebp`LIBWEBP_VERSION``v1.5.0`1.6 MBdwebp`LIBWEBP_VERSION``v1.5.0`1.3 MBavifenc`LIBAVIF_VERSION``v1.2.1`7.8 MBavifdec`LIBAVIF_VERSION``v1.2.1`7.7 MBgifsicle`GIFSICLE_VERSION``v1.96`1.3 MBffmpeg`FFMPEG_VERSION``n7.1.1`29 MBffprobe`FFMPEG_VERSION``n7.1.1`29 MBmagick`IMAGEMAGICK_VERSION``7.1.1-43`12 MB**Total****93 MB**Installation
------------

[](#installation)

```
composer require mathiasgrimm/laravel-cloud-binaries
```

Composer will symlink all 11 binaries into `vendor/bin/`.

Selective installation (faster deploys)
---------------------------------------

[](#selective-installation-faster-deploys)

If you only need a few binaries, you can install the package as a dev dependency, copy just the ones you need into your repository, and avoid downloading the full ~93 MB on every deploy:

```
composer require --dev mathiasgrimm/laravel-cloud-binaries

# Copy only the binaries you need into your project
mkdir -p bin
cp vendor/bin/jpegoptim bin/
cp vendor/bin/optipng bin/
cp vendor/bin/pngquant bin/

# Commit them
git add bin/
git commit -m "Add image optimization binaries"
```

Then reference them from your application using `base_path('bin/jpegoptim')` (or whichever path you chose). Since the binaries are committed to your repository, they are available immediately during deployment with no Composer overhead.

To keep your committed binaries in sync automatically when the package is updated, add a `post-update-cmd` script to your `composer.json`:

```
{
    "scripts": {
        "post-update-cmd": [
            "@php -r \"@mkdir('bin', 0755, true);\"",
            "@php -r \"copy('vendor/mathiasgrimm/laravel-cloud-binaries/bin/jpegoptim', 'bin/jpegoptim');\"",
            "@php -r \"copy('vendor/mathiasgrimm/laravel-cloud-binaries/bin/optipng', 'bin/optipng');\"",
            "@php -r \"copy('vendor/mathiasgrimm/laravel-cloud-binaries/bin/pngquant', 'bin/pngquant');\""
        ]
    }
}
```

After every `composer update`, the selected binaries are copied into `bin/` automatically. Adjust the list to include only the binaries you need. The `@php -r` syntax ensures the commands work on all platforms (Linux, macOS, and Windows).

Usage
-----

[](#usage)

After installation, the binaries are available in `vendor/bin/`:

```
vendor/bin/jpegoptim --strip-all image.jpg
vendor/bin/optipng -o2 image.png
vendor/bin/pngquant --quality=65-80 image.png
vendor/bin/cwebp -q 80 image.png -o image.webp
vendor/bin/dwebp image.webp -o image.png
vendor/bin/avifenc image.png image.avif
vendor/bin/avifdec image.avif image.png
vendor/bin/gifsicle -O3 animation.gif -o optimized.gif
vendor/bin/ffmpeg -i input.mp4 -c:v libx264 output.mp4
vendor/bin/ffprobe -v quiet -print_format json -show_format input.mp4
vendor/bin/magick input.png -resize 50% output.png
```

> **Note:** These are statically compiled Linux (musl) binaries. They will work on Laravel Cloud and other Linux environments but **not** on macOS or Windows.

Building from source
--------------------

[](#building-from-source)

### Prerequisites

[](#prerequisites)

- [Docker](https://docs.docker.com/get-docker/)
- `make`

### Build all binaries

[](#build-all-binaries)

```
make
```

Binaries are output to the `bin/` directory.

### Build a single binary

[](#build-a-single-binary)

```
make bin/jpegoptim
make bin/optipng
make bin/pngquant
make bin/cwebp
make bin/dwebp
make bin/avifenc
make bin/avifdec
make bin/gifsicle
make bin/ffmpeg
make bin/ffprobe
make bin/magick
```

### Parallel builds

[](#parallel-builds)

```
make -j4
```

### Testing

[](#testing)

Verify that all binaries work correctly by running them inside an Alpine Docker container:

```
make test          # build (if needed) + test
make test-only     # test without rebuilding
```

### Clean up

[](#clean-up)

```
make clean          # remove bin/ contents
make clean-images   # remove Docker images
make clean-all      # both
```

How it works
------------

[](#how-it-works)

Each tool has its own Dockerfile under `/Dockerfile`. The Dockerfiles use multi-stage Alpine builds:

1. **Builder stage** — installs dependencies, clones source, compiles with static linking flags
2. **Final stage** — `FROM scratch`, copies only the static binary

The Makefile orchestrates building the Docker images and extracting the binaries into `bin/`.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance81

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

2

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56f4dbd80bb6510bdc2adc49fcf7ec925cb45535b3bfdadf0964a09d678cf8ab?d=identicon)[mathiasgrimm](/maintainers/mathiasgrimm)

---

Top Contributors

[![mathiasgrimm](https://avatars.githubusercontent.com/u/450069?v=4)](https://github.com/mathiasgrimm "mathiasgrimm (13 commits)")

### Embed Badge

![Health badge](/badges/mathiasgrimm-laravel-cloud-binaries/health.svg)

```
[![Health](https://phpackages.com/badges/mathiasgrimm-laravel-cloud-binaries/health.svg)](https://phpackages.com/packages/mathiasgrimm-laravel-cloud-binaries)
```

PHPackages © 2026

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