PHPackages                             tihiy-production/php-image-compressor - 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. tihiy-production/php-image-compressor

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

tihiy-production/php-image-compressor
=====================================

ImageCompressor - this is an easy way to compress images on the fly

v2.4.0(1y ago)243.8k2MITPHPPHP &gt;=7.0.0

Since Feb 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tihiy-production/php-image-compressor)[ Packagist](https://packagist.org/packages/tihiy-production/php-image-compressor)[ Docs](https://github.com/tihiy-production/php-image-compressor.git)[ RSS](/packages/tihiy-production-php-image-compressor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (31)Used By (0)

Compress images
===============

[](#compress-images)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4994bfab0aaabe1f785191aa4cec74a2536e5d4081b1f5b44acea6c41cb2a0f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74696869792d70726f64756374696f6e2f7068702d696d6167652d636f6d70726573736f722e737667)](https://packagist.org/packages/tihiy-production/php-image-compressor)[![Total Downloads](https://camo.githubusercontent.com/6eabf454142fb98e720802b6a8b5c1fd64b9206bfbdc70890140628bf3f276e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74696869792d70726f64756374696f6e2f7068702d696d6167652d636f6d70726573736f722e737667)](https://packagist.org/packages/tihiy-production/php-image-compressor)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

**ImageCompressor** - this is an easy way to compress images on the fly.

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

[](#requirements)

The following libraries need to be installed:

### Jpegoptim &amp; Pngquant

[](#jpegoptim--pngquant)

```
sudo apt-get -y install jpegoptim pngquant

```

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

[](#installation)

Execute the following command to install this package as a dependency in your project:

```
composer require "tihiy-production/php-image-compressor"
```

Usage
-----

[](#usage)

You can choose a local file as the source and write it to another file.

```
$source = tihiy\Compressor\ImageCompressor::sourceFile('uncompressed.jpg');
$source->toFile('compressed.jpg');
```

You can upload an image content as the source and get the compressed image data.

```
$sourceData = file_get_contents('uncompressed.jpg');
$resultData = tihiy\Compressor\ImageCompressor::sourceContent($sourceData)->toContent();
```

You can specify URL as a source to the image and compress it without having to upload.

```
$source = tihiy\Compressor\ImageCompressor::sourceUrl('https://example.com/uncompressed.jpg');
$source->toFile('compressed.jpg');
```

License
-------

[](#license)

This software is licensed under the MIT License. [View the license](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% 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 ~47 days

Recently: every ~221 days

Total

29

Last Release

598d ago

Major Versions

v1.1.9 → v2.0.02021-02-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4bd35b2adf547e1c675057fae324b2c925cae21954fef9dbb117c93151f925b?d=identicon)[tihiy-production](/maintainers/tihiy-production)

---

Top Contributors

[![mktvr](https://avatars.githubusercontent.com/u/42260998?v=4)](https://github.com/mktvr "mktvr (78 commits)")[![tihiy-production](https://avatars.githubusercontent.com/u/78489538?v=4)](https://github.com/tihiy-production "tihiy-production (12 commits)")

---

Tags

compress-imagescompressicompressorimage-compressionjpegoptimphotosphpphp-librarypngquantphpcompressimagespngjpegpngquantjpegoptim

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tihiy-production-php-image-compressor/health.svg)

```
[![Health](https://phpackages.com/badges/tihiy-production-php-image-compressor/health.svg)](https://phpackages.com/packages/tihiy-production-php-image-compressor)
```

###  Alternatives

[picqer/php-barcode-generator

An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.

1.8k25.5M88](/packages/picqer-php-barcode-generator)[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4869.0k](/packages/jkphl-iconizr)[choowx/rasterize-svg

A PHP library for converting SVG to JPEG, PNG, and WEBP

2261.7k](/packages/choowx-rasterize-svg)[gtuk/image-optimizer

PHP image optimizer for png, jpeg and gif files. It uses mozjpeg, pngquant and gifsicle for the optimization process

161.6k](/packages/gtuk-image-optimizer)[rosell-dk/webp-convert-cloud-service

Cloud service for converting JPEG &amp; PNG to WebP

545.6k3](/packages/rosell-dk-webp-convert-cloud-service)

PHPackages © 2026

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