PHPackages                             ignited-developer/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. ignited-developer/php-image-compressor

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

ignited-developer/php-image-compressor
======================================

A sample PHP image-compressor is a lightweight PHP package that provides image compression and resizing functionality. It supports multiple image formats (JPEG, PNG, GIF, WebP, AVIF) and allows you to compress and resize images while maintaining quality.

22PHP

Since Jan 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AishwaryaKumar387/ignited-image-compressor)[ Packagist](https://packagist.org/packages/ignited-developer/php-image-compressor)[ RSS](/packages/ignited-developer-php-image-compressor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ignited-image-compressor
========================

[](#ignited-image-compressor)

ignited-image-compressor is a lightweight PHP package that provides image compression and resizing functionality.

```
    // Include the Composer autoloader
    require_once __DIR__ . '/vendor/autoload.php';

    // Use the correct namespace for your package
    use IgnitedDevPackage\IgnitedImageCompressor;

    // Path to the test image file
    $filePath = 'ryan-plomp-tFPgk_FNEzM-unsplash.png';  // Path to your image file

    // Check if the file exists
    if (file_exists($filePath)) {
        // Manually set the file array
        $file = array(
            'name' => basename($filePath), // Get the file name
            'tmp_name' => $filePath,       // Get the full path to the file
            'size' => filesize($filePath)  // Get the file size
        );

        // Set destination directory for compressed images
        $destination_dir = __DIR__ . '/compressed-images';

        // Ensure the destination directory exists
        if (!is_dir($destination_dir)) {
            mkdir($destination_dir, 0755, true); // Create directory if it doesn't exist
        }

        // Create destination image path with a unique name i.e. adjust with your file name
        $destination_image = $destination_dir . '/' . pathinfo($file['name'], PATHINFO_FILENAME) . '_compressed.' . pathinfo($file['name'], PATHINFO_EXTENSION);

        // Maximum width for resizing and quality level for JPEG
        $maxImgWidth = 900;
        $quality = 40;  // Quality for JPEG (0-100), PNG, WebP, and AVIF use a level (0-9)

        // Create an instance of the image compressor
        $compressor = new IgnitedImageCompressor();

        // Call the method to compress and resize the image
        $result = $compressor->ignitedCompressAndResizeImage($file, $destination_image, $maxImgWidth, $quality);

        // Output the result
        print_r($result);
    } else {
        print_r(array('status' => 'error', 'message' => 'The specified file does not exist.'));
    }

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bc18c83f11e3f58af94d5a316f7ce583e5e6a876ce604532bdc03379e7405ee?d=identicon)[AishwaryaKumar387](/maintainers/AishwaryaKumar387)

---

Top Contributors

[![AishwaryaKumar387](https://avatars.githubusercontent.com/u/62651625?v=4)](https://github.com/AishwaryaKumar387 "AishwaryaKumar387 (6 commits)")

### Embed Badge

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

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

###  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)
