PHPackages                             titi23/image-optimizer-and-resizer - 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. titi23/image-optimizer-and-resizer

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

titi23/image-optimizer-and-resizer
==================================

Optimize And Resize Images in server

02[1 issues](https://github.com/petritlame/image-optimizer-and-resizer/issues)PHP

Since Jun 21Pushed 6y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Optimize and Resize images with Laravel in a few lines of code
==============================================================

[](#optimize-and-resize-images-with-laravel-in-a-few-lines-of-code)

This package can compress .png, .jpeg and .gif files. Here's how you can use it:

Compress Image, you can optimize the uploaded image or you can save both of them

```
use titi23\ImageOptimizer\ImageOptimize;

$optimizedImage = new ImageOptimize();

$optimizedImage->ImageOptimized($pathToImage, $saveOriginal);
```

Resize Image without losing the `AspectRatio` of the original Image

```
use titi23\ImageOptimizer\ImageOptimize;

$optimizedImage = new ImageOptimize();

$optimizedImage->ResizeAspectRatio($pathToImage, $percent, $saveOriginal);
```

Resize Image with new width but not losing AspectRatio of the original image (without stretching the new image)

```
use titi23\ImageOptimizer\ImageOptimize;

$optimizedImage = new ImageOptimize();

$optimizedImage->ResizeWidth($pathToImage, $newWidth, $saveOriginal);
```

### Installation

[](#installation)

You can install the package via composer:

```
composer require titi23/image-optimizer-and-resizer
```

Copy and Paste the Service Provider in config/app.php

```
'providers' => [
 ...
 ...
 titi23\ImageOptimizer\ImageOptimizerServiceProvider::class
 ...
]
```

After that, publish the package by running this in your terminal

```
 php artisan vendor:publish --tag=image-optimizer --force
```

### Configuration

[](#configuration)

In the config directory of your project it must be generated a file called `image-optimizer.php`

Description for each attribute:

- `upload_dir` write the name of the directory where you will upload your images e.g. 'uploads/' -ps: the folder must be inside `public`.
- `supportedFormat` array of the types of images that are allowed.
- `compressRate` amount of the compression that image passes through, value between 1 and 100, 1: low quality, 100: high quality
- `resize_percent` percent of the resize of the image, value between 1 and 100, e.g. 50, half of the original version

Credits
-------

[](#credits)

- [Petrit Lame](https://github.com/petritlame/)

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/882e1ba48c993645ff06f07d687bc4dc6666d4bdb9e9bd9ac1c80465a1adbeac?d=identicon)[titi23](/maintainers/titi23)

---

Top Contributors

[![petrit-lame](https://avatars.githubusercontent.com/u/32936245?v=4)](https://github.com/petrit-lame "petrit-lame (5 commits)")[![petritlame](https://avatars.githubusercontent.com/u/48964432?v=4)](https://github.com/petritlame "petritlame (3 commits)")

### Embed Badge

![Health badge](/badges/titi23-image-optimizer-and-resizer/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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