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 1w 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

Maintenance29

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

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

[goat1000/svggraph

Generates SVG graphs

135931.0k3](/packages/goat1000-svggraph)[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

138121.6k7](/packages/stefangabos-zebra-image)[treinetic/imageartist

ImageArtist is a php gd Wrapper which makes Image manipulation insanely easy, we introduce ImageArtist as Photoshop for php

8783.2k](/packages/treinetic-imageartist)[johncarter/filament-focal-point-picker

An image focal point picker for Filament Admin.

4431.7k1](/packages/johncarter-filament-focal-point-picker)[yk/laravel-ocr

A wrapper for gocr.

1356.6k](/packages/yk-laravel-ocr)

PHPackages © 2026

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