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 today

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

Maintenance30

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://avatars.githubusercontent.com/u/62651625?v=4)[Aishwarya Kumar](/maintainers/AishwaryaKumar387)[@AishwaryaKumar387](https://github.com/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

[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

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

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

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