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

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

dmknvk/laravel-image-optimizer
==============================

Images optimization for Google PageSpeed Insights

v0.1.2(8y ago)111.2k2MITPHPPHP &gt;=5.5.9

Since Nov 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dmknvk/laravel-image-optimizer)[ Packagist](https://packagist.org/packages/dmknvk/laravel-image-optimizer)[ RSS](/packages/dmknvk-laravel-image-optimizer/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Laravel Image Optimizer
-----------------------

[](#laravel-image-optimizer)

[![Packagist License](https://camo.githubusercontent.com/2019e25c736c5f79a5d06e01952ad294669a6ad0b23a87d720a7377b55e9df29/68747470733a2f2f706f7365722e707567782e6f72672f646d6b6e766b2f6c61726176656c2d696d6167652d6f7074696d697a65722f6c6963656e73652e706e67)](http://choosealicense.com/licenses/mit/)[![Latest Stable Version](https://camo.githubusercontent.com/0c08da1b3b3d97ff128cf176fe55e8eb79374ba9656c9e93a41854c062795e87/68747470733a2f2f706f7365722e707567782e6f72672f646d6b6e766b2f6c61726176656c2d696d6167652d6f7074696d697a65722f76657273696f6e2e706e67)](https://packagist.org/packages/dmknvk/laravel-image-optimizer)[![Total Downloads](https://camo.githubusercontent.com/1620879d8cf2f900bc27003ba9c78eacb5c4256c9dac8e8d9684f081ee022479/68747470733a2f2f706f7365722e707567782e6f72672f646d6b6e766b2f6c61726176656c2d696d6167652d6f7074696d697a65722f642f746f74616c2e706e67)](https://packagist.org/packages/dmknvk/laravel-image-optimizer)

This is a package for Laravel 5 that optimize images for Google PageSpeed Insights requirements.

Requirements
------------

[](#requirements)

This package uses the following tools in your system:

- [optipng](http://optipng.sourceforge.net/) (tested on v0.7.6)
- [jpegoptim](http://freecode.com/projects/jpegoptim/) (tested on v1.4.4)

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

[](#installation)

Require this package with composer:

```
composer require dmknvk/laravel-image-optimizer
```

After updating composer, add the ServiceProvider to the providers array in config/app.php

```
DmKnvk\LaravelImageOptimizer\ServiceProvider::class,
```

Copy the package config to your local config with the publish command:

```
php artisan vendor:publish --provider="DmKnvk\LaravelImageOptimizer\ServiceProvider"
```

Usage
-----

[](#usage)

Set your directories pathes that will be optimized in config/image-optimizer.php

```
'dirs' => [
  public_path('media'),            // all png/jpeg images in folder public/media will be optimized recursively
  public_path('upload') => [
    'types'     => ['images/png'], // array of mime types, that will be optimized (now supported image/png and image/jpeg)
    'recursive' => false,          // search images only in root directory (public/upload)
  ],
],
```

Run artisan command (or add to cron) with root priveleges (to avoid problems with permissions)

```
sudo php artisan image-optimizer:run
```

All files in your directories will be optimized with max optimization levels (takes some time).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Every ~190 days

Total

3

Last Release

3133d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4293251?v=4)[Dmitry](/maintainers/dmknvk)[@dmknvk](https://github.com/dmknvk)

---

Top Contributors

[![dmknvk](https://avatars.githubusercontent.com/u/4293251?v=4)](https://github.com/dmknvk "dmknvk (10 commits)")

---

Tags

laravelInsightsimagesoptimizationPageSpeed

### Embed Badge

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

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

###  Alternatives

[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M160](/packages/intervention-image-laravel)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4923.6k5](/packages/ralphjsmit-laravel-glide)

PHPackages © 2026

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