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

ActiveProject[Image &amp; Media](/categories/media)

jonathanmaron/image-optimizer
=============================

Image optimization and compression tool for the console. This tool optimizes PNG, JPEG and GIF files, using 'gifsicle', 'jpegoptim', 'jpegtran', 'pngcrush' and 'pngout' and can usually reduce the filesize by 10% to 70%.

2.0.0(7y ago)5452[2 PRs](https://github.com/jonathanmaron/image-optimizer/pulls)BSD-3-ClausePHPPHP ^7.1

Since Apr 25Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (10)Versions (18)Used By (0)

Image Optimizer
===============

[](#image-optimizer)

Image optimization and compression tool for the console. This tool optimizes PNG, JPEG and GIF files, using `gifsicle`, `jpegoptim`, `jpegtran`, `pngcrush` and `pngout` and can usually reduce the filesize by 10% to 70%.

As optimzing images is CPU intensive and it may take several minutes for a larger PNG file, `image-optimizer` keeps track of which image files it has optimized. Each image file will only be optimize once, unless the `--force` flag is set.

`image-optimizer` is intended to be run unattended in a cronjob.

Example Usage
-------------

[](#example-usage)

### Optimize Images In `/path/to/images`

[](#optimize-images-in-pathtoimages)

```
image-optimizer --path="/path/to/images"

```

### Optimize Images In `/path/to/images`, Ignoring History

[](#optimize-images-in-pathtoimages-ignoring-history)

```
image-optimizer --path="/path/to/images" --force

```

### Set All Images In `/path/to/images` As Optimized

[](#set-all-images-in-pathtoimages-as-optimized)

```
image-optimizer --path="/path/to/images" --index-only

```

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

[](#installation)

Installation is via composer:

```
cd ~/install-path

composer create-project jonathanmaron/image-optimizer

```

It is recommended to include `~/bin` in your `PATH` variable:

```
PATH=$PATH:~/install-path/image-optimizer/bin

```

so that `image-optimizer` is available to the logged in user globally.

Upgrading From v1 and v2
------------------------

[](#upgrading-from-v1-and-v2)

Between v1 and v3, the structure of the history directory was updated. Therefore, please remove your current history directory. A new one, with the new structure, will be created when `image-optimizer` is executed for the first time:

```
rm -fr ~/.image_optimizer

```

Dependencies
------------

[](#dependencies)

`image-optimizer` depends upon `gifsicle`, `jpegoptim`, `jpegtran`, `pngcrush` and `pngout` to perform its work. These tools must be installed, otherwise `image-optimizer` will return an error.

Download and install `pngout` at:

```
http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux-static.tar.gz (or newer)

```

then unpack, then copy to:

```
/usr/bin/pngout

```

Download and install other dependencies:

```
apt install pngcrush libjpeg-progs jpegoptim gifsicle

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Recently: every ~79 days

Total

14

Last Release

2907d ago

Major Versions

1.2.2 → 2.0.02018-05-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/18d8bc9bdee8ab1b0cfccce6a06d2438acbed3a58b0046c4834c5678f6769342?d=identicon)[jonathanmaron](/maintainers/jonathanmaron)

---

Top Contributors

[![jonathanmaron](https://avatars.githubusercontent.com/u/298462?v=4)](https://github.com/jonathanmaron "jonathanmaron (98 commits)")

---

Tags

image-compressionimage-optimizationoptimize-imagesweb-performanceimagecompressionimage-optimizeroptimizationpngcrushpngoutjpegtran

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[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)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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