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)3331.9k↑125%10[2 issues](https://github.com/justbetter/magento2-image-optimizer/issues)MITPHPPHP &gt;=7.0

Since Apr 6Pushed 7y ago4 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 2w 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 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community14

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

2862d 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

Manipulate images with an expressive API

1.4k63.1M206](/packages/spatie-image)[spatie/image-optimizer

Easily optimize images using PHP

2.9k82.5M181](/packages/spatie-image-optimizer)[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[magepal/magento2-gmailsmtpapp

Magento 2 SMTP Extension - Configure Magento 2 to send all transactional email using Gmail, G Suite, Amazon SES, Office360, Mailgun, SendGrid, Mandrill or any other SMTP servers

3271.9M2](/packages/magepal-magento2-gmailsmtpapp)[yireo/magento2-next-gen-images

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

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

Optimize your Filament images before they reach your database.

113168.1k12](/packages/joshembling-image-optimizer)

PHPackages © 2026

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