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

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

misteram/image-optimizer
========================

A responsive image workflow for optimizing and resizing your images

1.0.0(8y ago)06MITPHPPHP &gt;=5.3.0

Since Sep 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dotsplatform/image-optimizer)[ Packagist](https://packagist.org/packages/misteram/image-optimizer)[ Docs](https://github.com/misteram/image-optimizer/)[ RSS](/packages/misteram-image-optimizer/feed)WikiDiscussions master Synced 3d ago

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

image-optimizer
===============

[](#image-optimizer)

A responsive image workflow for optimizing and resizing your images.

Full documentation available at .

Requirements/dependencies
-------------------------

[](#requirementsdependencies)

- [PHP &gt;= 5.3.0](http://php.net/)
- [ImageMagick](http://imagemagick.org/)
- [ext-imagick](http://php.net/manual/en/book.imagick.php)
- For optimization, depending on what settings you pass:
    - [SVGO](https://github.com/svg/svgo)
    - [image\_optim](https://github.com/toy/image_optim)
    - [picopt](https://github.com/ajslater/picopt)
    - [ImageOptim](https://imageoptim.com/)

Examples
--------

[](#examples)

To resize one raster image, without optimization:

```
$image = new nwtn\Respimg($input_filename);
$image->smartResize($output_width, $output_height, false);
$image->writeImage($output_filename);
```

To resize one raster image and maintain aspect ratio, without optimization:

```
$image = new nwtn\Respimg($input_filename);
$image->smartResize($output_width, 0, false);
$image->writeImage($output_filename);
```

To resize one raster image and maintain aspect ratio, with optimization:

```
$image = new nwtn\Respimg($input_filename);
$image->smartResize($output_width, 0, true);
$image->writeImage($output_filename);
nwtn\Respimg::optimize($output_filename, 0, 1, 1, 1);
```

To resize a directory of raster images and maintain aspect ratio, with optimization:

```
$exts = array('jpeg', 'jpg', 'png');
if ($dir = opendir($input_path)) {
	while (($file = readdir($dir)) !== false) {
		$base = pathinfo($file, PATHINFO_BASENAME);
		$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
		if (in_array($ext, $exts)) {
			$image = new nwtn\Respimg($input_path . '/' . $file);
			$image->smartResize($width, 0, true);
			$image->writeImage($output_path . '/' . $base . '-w' . $w . '.' . $ext);
		}
	}
}
nwtn\Respimg::optimize($output_path, 0, 1, 1, 1);
```

To resize a directory of raster images and SVGs and maintain aspect ratio, with optimization:

```
$exts = array('jpeg', 'jpg', 'png');
if ($dir = opendir($input_path)) {
	while (($file = readdir($dir)) !== false) {
		$base = pathinfo($file, PATHINFO_BASENAME);
		$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
		if (in_array($ext, $exts)) {
			$image = new nwtn\Respimg($input_path . '/' . $file);
			$image->smartResize($width, 0, true);
			$image->writeImage($output_path . '/' . $base . '-w' . $w . '.' . $ext);
		} elseif ($ext === 'svg') {
			copy($input_path . '/' . $file, $output_path . '/' . $file);
			nwtn\Respimg::rasterize($input_path . '/' . $file, $output_path . '/', $width, 0);
		}
	}
}
nwtn\Respimg::optimize($output_path, 3, 1, 1, 1);
```

Release History
---------------

[](#release-history)

### 1.0.6

[](#106)

- Remove phantom.js
- Updated composer

### 1.0.1

[](#101)

- Library loading bug fix
- Namespacing in README

### 1.0.0

[](#100)

- Major refactoring
- Image optimization
- SVG rasterization
- Basic (non-unit) tests

### 0.0.2

[](#002)

- Fix a path in the test file
- Minor colorspace change (should have no effect on output)
- Comments and stuff

### 0.0.1

[](#001)

- Packagist release

### 0.0.0

[](#000)

- Super experimental pre-release. Feel free to mess about with it, but don’t expect much.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3150d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d9e72f4aaec1eb6f15b12504604863656c73ba4d536d2d090e414d8ce563923?d=identicon)[dotsplatfolrm](/maintainers/dotsplatfolrm)

---

Top Contributors

[![dotsplatform](https://avatars.githubusercontent.com/u/32359445?v=4)](https://github.com/dotsplatform "dotsplatform (8 commits)")

---

Tags

ImageMagickimagickresizerwdResponsive Imagesrespimgresponsive web design

### Embed Badge

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

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

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[francodacosta/phmagick

image manipulation with php and ImageMagick

3869.7k1](/packages/francodacosta-phmagick)[orbitale/imagemagick-php

A system that allows creating commands to send to the exec() function to use ImageMagick's powerful features.

43385.7k1](/packages/orbitale-imagemagick-php)[admad/cakephp-glide

CakePHP plugin for using Glide image manipulation library.

34160.7k1](/packages/admad-cakephp-glide)

PHPackages © 2026

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