PHPackages                             eihror/compress-image - 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. eihror/compress-image

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

eihror/compress-image
=====================

Compress your image without losing quality

v0.0.6(7y ago)336.8k↑33.3%19[3 issues](https://github.com/eihror/compress-image/issues)2MITPHPPHP &gt;=5.3.0

Since Nov 12Pushed 6y ago4 watchersCompare

[ Source](https://github.com/eihror/compress-image)[ Packagist](https://packagist.org/packages/eihror/compress-image)[ Docs](https://github.com/eihror/compress-image)[ RSS](/packages/eihror-compress-image/feed)WikiDiscussions v0.0.6 Synced 1mo ago

READMEChangelog (5)DependenciesVersions (10)Used By (2)

[![Latest Stable Version](https://camo.githubusercontent.com/fbeb66087b2a07edc5f679127f1e798ae5ee6cfff868e291dfa6b8a9ad455b67/68747470733a2f2f706f7365722e707567782e6f72672f656968726f722f636f6d70726573732d696d6167652f762f737461626c65)](https://packagist.org/packages/eihror/compress-image)[![Total Downloads](https://camo.githubusercontent.com/7eb1d2e784683d2df86c7476fd107b88520add64c77d38ae7f20bc3596f981c4/68747470733a2f2f706f7365722e707567782e6f72672f656968726f722f636f6d70726573732d696d6167652f646f776e6c6f616473)](https://packagist.org/packages/eihror/compress-image)[![Latest Unstable Version](https://camo.githubusercontent.com/596166c90fcc8233fd7b8e052711a94cc9d8f08176c1fddef27923a776801d3b/68747470733a2f2f706f7365722e707567782e6f72672f656968726f722f636f6d70726573732d696d6167652f762f756e737461626c65)](https://packagist.org/packages/eihror/compress-image)[![License](https://camo.githubusercontent.com/069fbfa3e2359dcf7358067047dfbd497e04aa1249ba0773890b59823135c981/68747470733a2f2f706f7365722e707567782e6f72672f656968726f722f636f6d70726573732d696d6167652f6c6963656e7365)](https://packagist.org/packages/eihror/compress-image)

Compress Image
==============

[](#compress-image)

Compress your image without losing quality

How to use
----------

[](#how-to-use)

Clone this project inside the project that you want to use

```
composer require eihror/compress-image

```

Create variables to receive the elements

```
$file = 'koala.jpg'; //file that you wanna compress
$new_name_image = 'koala_mini'; //name of new file compressed
$quality = 60; // Value that I chose
$pngQuality = 9; // Exclusive for PNG files
$destination = 'content'; //This destination must be exist on your project
$maxsize = 5245330; //Set maximum image size in bytes. if no value given 5mb by default.

```

**The quality works only for JPG�s images. But if you want to change the file to PNG�s, you have to change manually via code. GIF doesn't affect the quality**

Default quality for PNG: **9 ( 0 - no compression, 9 - max compression )**Create a new instance of a class

```
$image_compress = new Eihror\Compress\Compress($file, $new_name_image, $quality, $pngQuality, $destination, $maxsize);

```

And make the compression calling the function **compress\_image**

```
$image_compress->compress_image();

```

This function will return only the name of new image compressed with your respective extension

That´s it! Feel free to use and making the code better if you find something different or wrong

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.4% 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 ~119 days

Recently: every ~81 days

Total

9

Last Release

2522d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b90fa6640ecea827e3c16d82f478f00e4d6ae96bd02b270b4cacb4d48ed85f7?d=identicon)[eihror](/maintainers/eihror)

---

Top Contributors

[![eihror](https://avatars.githubusercontent.com/u/5113532?v=4)](https://github.com/eihror "eihror (38 commits)")[![AjithLalps](https://avatars.githubusercontent.com/u/18158025?v=4)](https://github.com/AjithLalps "AjithLalps (3 commits)")[![adaamz](https://avatars.githubusercontent.com/u/4347332?v=4)](https://github.com/adaamz "adaamz (1 commits)")[![bardcrack](https://avatars.githubusercontent.com/u/8503160?v=4)](https://github.com/bardcrack "bardcrack (1 commits)")

### Embed Badge

![Health badge](/badges/eihror-compress-image/health.svg)

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

###  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)[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)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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