PHPackages                             abdelhamiderrahmouni/image-optimizer-command - 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. abdelhamiderrahmouni/image-optimizer-command

ActiveLibrary

abdelhamiderrahmouni/image-optimizer-command
============================================

A package that offers a command for image optimization using spatie/image-optimizer under the hood.

v0.1.2(2y ago)049[4 PRs](https://github.com/abdelhamiderrahmouni/image-optimizer-command/pulls)MITPHPPHP ^8.1CI passing

Since Feb 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/abdelhamiderrahmouni/image-optimizer-command)[ Packagist](https://packagist.org/packages/abdelhamiderrahmouni/image-optimizer-command)[ Docs](https://github.com/abdelhamiderrahmouni/image-optimizer-command)[ GitHub Sponsors]()[ RSS](/packages/abdelhamiderrahmouni-image-optimizer-command/feed)WikiDiscussions main Synced 1mo ago

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

Image Optimizer Command
=======================

[](#image-optimizer-command)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ee80160bc9713a780fd101b97f955cb2c6a07d33ab87ea40b7e198bcd8769734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264656c68616d696465727261686d6f756e692f696d6167652d6f7074696d697a65722d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abdelhamiderrahmouni/image-optimizer-command)[![GitHub Tests Action Status](https://camo.githubusercontent.com/99298646b3b41ba537133101d0ca1467f4e69ed4182b8d57ff77e08b812df689/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616264656c68616d696465727261686d6f756e692f696d6167652d6f7074696d697a65722d636f6d6d616e642f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/abdelhamiderrahmouni/image-optimizer-command/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a472dbcd7198e9d59a7760a9b046ccc193bba129d0d04e4312986a1047889e71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616264656c68616d696465727261686d6f756e692f696d6167652d6f7074696d697a65722d636f6d6d616e642f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/abdelhamiderrahmouni/image-optimizer-command/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/5be82a6328b66946f94f092c9cddf8dbfccf6cc2ad1820b71ed2a8c1c1cdf475/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616264656c68616d696465727261686d6f756e692f696d6167652d6f7074696d697a65722d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abdelhamiderrahmouni/image-optimizer-command)

A package that offers a command for image optimization using spatie/image-optimizer under the hood.

Pre-requisites
--------------

[](#pre-requisites)

### Optimization tools

[](#optimization-tools)

The package will use these optimizers if they are present on your system:

- [JpegOptim](https://github.com/tjko/jpegoptim)
- [Optipng](http://optipng.sourceforge.net/)
- [Pngquant 2](https://pngquant.org/)
- [SVGO 1](https://github.com/svg/svgo)
- [Gifsicle](http://www.lcdf.org/gifsicle/)
- [cwebp](https://developers.google.com/speed/webp/docs/precompiled)
- [avifenc](https://github.com/AOMediaCodec/libavif/blob/main/doc/avifenc.1.md)

Here's how to install all the optimizers on Ubuntu/Debian:

```
sudo apt-get install jpegoptim
sudo apt-get install optipng
sudo apt-get install pngquant
sudo npm install -g svgo
sudo apt-get install gifsicle
sudo apt-get install webp
sudo apt-get install libavif-bin # minimum 0.9.3
```

And here's how to install the binaries on MacOS (using [Homebrew](https://brew.sh/)):

```
brew install jpegoptim
brew install optipng
brew install pngquant
npm install -g svgo
brew install gifsicle
brew install webp
brew install libavif
```

And here's how to install the binaries on Fedora/RHEL/CentOS:

```
sudo dnf install epel-release
sudo dnf install jpegoptim
sudo dnf install optipng
sudo dnf install pngquant
sudo npm install -g svgo
sudo dnf install gifsicle
sudo dnf install libwebp-tools
sudo dnf install libavif-tools
```

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

[](#installation)

I recommend you use this package in local environment only, even if it is possible to use it in production environment, it is not recommended to use it in production.

You can install the package via composer:

```
composer require abdelhamiderrahmouni/image-optimizer-command --dev
```

You can publish the config file with:

```
php artisan vendor:publish --tag="image-optimizer-command-config"
```

This is the contents of the published config file:

```
return [
    /*
     * The path to the assets folder. Default is public/assets.
     */
    'assets_path' => 'public/assets',
];
```

Usage
-----

[](#usage)

```
    php artisan images:compress [path/to/assets]
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Abdelhamid Errahmouni](https://github.com/abdelhamiderrahmouni)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance64

Regular maintenance activity

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

821d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/745a0575996f5a3dcb6b8e177e5f37e610d83906028a1e99aa2ec3213a281027?d=identicon)[abdelhamiderrahmouni](/maintainers/abdelhamiderrahmouni)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![abdelhamiderrahmouni](https://avatars.githubusercontent.com/u/26693672?v=4)](https://github.com/abdelhamiderrahmouni "abdelhamiderrahmouni (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![errahmouniabdelhamid](https://avatars.githubusercontent.com/u/87318869?v=4)](https://github.com/errahmouniabdelhamid "errahmouniabdelhamid (1 commits)")

---

Tags

laravelAbdelhamid Errahmouniimage-optimizer-command

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/abdelhamiderrahmouni-image-optimizer-command/health.svg)

```
[![Health](https://phpackages.com/badges/abdelhamiderrahmouni-image-optimizer-command/health.svg)](https://phpackages.com/packages/abdelhamiderrahmouni-image-optimizer-command)
```

###  Alternatives

[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[abdelhamiderrahmouni/filament-monaco-editor

A monaco editor form field for filamentphp.

18182.2k](/packages/abdelhamiderrahmouni-filament-monaco-editor)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

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