PHPackages                             masum-nishat/image-resize-php - 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. masum-nishat/image-resize-php

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

masum-nishat/image-resize-php
=============================

Resize image to desire file size by only one compression

v1.1.0(6y ago)025[1 PRs](https://github.com/MasumNishat/imageResize/pulls)Apache-2.0PHPPHP &gt;=7.2.0

Since Nov 16Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/MasumNishat/imageResize)[ Packagist](https://packagist.org/packages/masum-nishat/image-resize-php)[ RSS](/packages/masum-nishat-image-resize-php/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (6)Used By (0)

image-resize-php
================

[](#image-resize-php)

PHP library to resize image to desire file size by only one compression.

---

Warning
-------

[](#warning)

This is a development package. I encourage not to use in production environment.

Please inform if any bug or security issue or any other problem found.

Any suggestion will be taken seriously.

Setup
-----

[](#setup)

This package is available through Packagist with the vendor and package identifier the same as this repo.

If using [Composer](https://getcomposer.org/), run following command:

```
composer require "masum-nishat/image-resize-php":"^1.1.0"
```

> Note: This library uses GD class which do not support resizing animated gif files

---

Resize
------

[](#resize)

Only supported resizing param is according to file size. Image dimension will be changed and final image will be under 250KB (Default).

```
imageResize::convert('image.jpg', 'image-converted.jpg');
//or
imageResize::convert('image.png', 'image-converted.png');
```

Let the extension detect automatically from mime type:

```
imageResize::convert('image.jpg', 'image-converted');
//or
imageResize::convert('image.png', 'image-converted');
```

Declare required maximum size:

```
imageResize::$targetSize = 300000; //maximum 300KB

imageResize::convert('image.jpg', 'image-converted');
//or
imageResize::convert('image.png', 'image-converted');
```

This class creat unique temp directory and delete it after using. To use custom temp directory and not delete temp components (useful for debugging):

```
imageResize::$tempDir = 'path/to/temp/folder';

imageResize::convert('image.jpg', 'image-converted');
//or
imageResize::convert('image.png', 'image-converted');
```

Supported Image Types
---------------------

[](#supported-image-types)

- `IMAGETYPE_JPEG`
- `IMAGETYPE_PNG`
- `IMAGETYPE_GIF`

Quality
-------

[](#quality)

Maximum quality is selected by default.

Quality change param is not implemented yet;

Exceptions
----------

[](#exceptions)

Exception handling not implemented yet.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance48

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~0 days

Total

3

Last Release

2365d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71c08df272658ed6e884da99d06b9681bbda63b5501dbfbedd9d8897f4b2cae7?d=identicon)[MasumNishat](/maintainers/MasumNishat)

---

Top Contributors

[![MasumNishat](https://avatars.githubusercontent.com/u/11717288?v=4)](https://github.com/MasumNishat "MasumNishat (13 commits)")

---

Tags

file-sizeone-compressionresize-image

### Embed Badge

![Health badge](/badges/masum-nishat-image-resize-php/health.svg)

```
[![Health](https://phpackages.com/badges/masum-nishat-image-resize-php/health.svg)](https://phpackages.com/packages/masum-nishat-image-resize-php)
```

###  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.0k22](/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)
