PHPackages                             justbetter/magento2-image-optimizer - 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. justbetter/magento2-image-optimizer

AbandonedArchivedMagento2-module[Image &amp; Media](/categories/media)

justbetter/magento2-image-optimizer
===================================

Magento 2 Image optimizer wrapper build on https://github.com/spatie/image-optimize

1.2.0(7y ago)4229.6k↓52.4%10[2 issues](https://github.com/justbetter/magento2-image-optimizer/issues)MITPHPPHP &gt;=7.0

Since Apr 6Pushed 7y ago8 watchersCompare

[ Source](https://github.com/justbetter/magento2-image-optimizer)[ Packagist](https://packagist.org/packages/justbetter/magento2-image-optimizer)[ RSS](/packages/justbetter-magento2-image-optimizer/feed)WikiDiscussions master Synced 1mo ago

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

Magento 2 Image Optimizer
=========================

[](#magento-2-image-optimizer)

This Magento 2 module is a wrapper based on the package [Spatie Image optimizer](https://github.com/spatie/image-optimizer).

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

[](#installation)

- `composer require justbetter/magento2-image-optimizer`
- `bin/magento module:enable JustBetter_ImageOptimizer`
- `bin/magento setup:upgrade && bin/magento setup:static-content:deploy`

### Optimize all images in console

[](#optimize-all-images-in-console)

- Run `bin/magento justbetter:imageoptimizer:optimizeall` to resize all images in the media folder.
- Additional parameters (will overwrite any option in the magento config):
    - `--jpg_compression="85"`
    - `--jpg_strip_all="1"`
    - `--jpg_all_progressive="0"`
    - `--png_quality_min_max="10-15"`
    - `--png_interlace="0"`
    - `--png_optimization_level="8"`

### Optimization tools

[](#optimization-tools)

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

- [JpegOptim](http://freecode.com/projects/jpegoptim)
- [Optipng](http://optipng.sourceforge.net/)
- [Pngquant 2](https://pngquant.org/)
- [SVGO](https://github.com/svg/svgo)
- [Gifsicle](http://www.lcdf.org/gifsicle/)

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

```
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
```

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

```
brew install jpegoptim
brew install optipng
brew install pngquant
brew install svgo
brew install gifsicle
```

Configuration
-------------

[](#configuration)

- Options for the module are defined in the backend under Stores &gt; Configuration &gt; JustBetter &gt; Image optimizer configuration.
- Possible options:
    - Log the compression in the system.log
    - Change compression of jpg files
    - Change compression of png files

Compatibility
-------------

[](#compatibility)

The module is tested on magento version 2.2.x with Spatie image optimizer version 1.0.x

Ideas, bugs or suggestions?
---------------------------

[](#ideas-bugs-or-suggestions)

Please create a [issue](https://github.com/justbetter/magento2-image-optimizer/issues) or a [pull request](https://github.com/justbetter/magento2-image-optimizer/pulls).

Todo
----

[](#todo)

- Configurable options for compression
- Compress all library images in console command

About us
--------

[](#about-us)

We’re a innovative development agency from The Netherlands building awesome websites, webshops and web applications with Laravel and Magento. Check out our website [justbetter.nl](https://justbetter.nl) and our [open source projects](https://github.com/justbetter).

License
-------

[](#license)

[MIT](LICENSE)

---

[![JustBetter logo](https://raw.githubusercontent.com/justbetter/art/master/justbetter-logo.png)](https://justbetter.nl "JustBetter")

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92.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

Every ~96 days

Total

3

Last Release

2771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d00b3f55cd4ae8b8cfb001a644ed6c7a1127a956c24375bcfe16ce12bd89bed?d=identicon)[justbetter](/maintainers/justbetter)

---

Top Contributors

[![rakibabu](https://avatars.githubusercontent.com/u/14089150?v=4)](https://github.com/rakibabu "rakibabu (13 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (1 commits)")

---

Tags

image-processingmagento2magento2-extensionphpimage-optimizermagento 2justbetter

### Embed Badge

![Health badge](/badges/justbetter-magento2-image-optimizer/health.svg)

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

###  Alternatives

[spatie/image-optimizer

Easily optimize images using PHP

2.9k71.3M109](/packages/spatie-image-optimizer)[ps/image-optimizer

Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

9341.7M25](/packages/ps-image-optimizer)[yireo/magento2-next-gen-images

Magento 2 module to add NextGen images support to the Magento frontend

471.1M2](/packages/yireo-magento2-next-gen-images)[joshembling/image-optimizer

Optimize your Filament images before they reach your database.

111145.4k12](/packages/joshembling-image-optimizer)[typisttech/image-optimize-command

Easily optimize images using WP CLI

1722.0k](/packages/typisttech-image-optimize-command)[justbetter/statamic-image-optimize

Image optimization after upload

1315.2k](/packages/justbetter-statamic-image-optimize)

PHPackages © 2026

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