PHPackages                             daiyanmozumder/image-wizard - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. daiyanmozumder/image-wizard

ActiveLibrary[Queues &amp; Workers](/categories/queues)

daiyanmozumder/image-wizard
===========================

Enterprise Laravel Image Processing Package powered by Python

v1.0.0(today)00MITPHPPHP ^8.1|^8.2|^8.3

Since Jun 27Pushed todayCompare

[ Source](https://github.com/DaiyanMozumder/image-wizard)[ Packagist](https://packagist.org/packages/daiyanmozumder/image-wizard)[ RSS](/packages/daiyanmozumder-image-wizard/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

 [![Image Wizard](https://raw.githubusercontent.com/daiyanmozumder/image-wizard/main/art/logo.png)](https://raw.githubusercontent.com/daiyanmozumder/image-wizard/main/art/logo.png)

 **Enterprise Laravel Image Processing powered by Python**

 [![Latest Version on Packagist](https://camo.githubusercontent.com/0d492140efcb75fc6a28bff9f46360caf99c9912960bb8c522a83732b6e928d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616979616e6d6f7a756d6465722f696d6167652d77697a6172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daiyanmozumder/image-wizard) [![Total Downloads](https://camo.githubusercontent.com/84814d076e639464cd979ec2ce2947f6b46339ce6a4c40724efe5ddc456ed969/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616979616e6d6f7a756d6465722f696d6167652d77697a6172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daiyanmozumder/image-wizard) [![PHP Version Require](https://camo.githubusercontent.com/d68c43b7765c1931a45e4e26e132a2eecdb9cb8c74a57971da466df83b0c6581/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64616979616e6d6f7a756d6465722f696d6167652d77697a6172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daiyanmozumder/image-wizard) [![License](https://camo.githubusercontent.com/40280856210c46450b6b1fd2f7121d287601ffad98171eb458371ed26a850221/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d737563636573732e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

---

**Image Wizard** is an enterprise-grade Laravel image processing package. Instead of relying on PHP's memory-hungry GD/Imagick libraries, it bridges Laravel to a high-performance Python engine powered by the `Pillow` library.

Laravel handles the orchestration, fluent API, and background queueing, while Python executes the heavy CPU-bound image manipulation.

✨ Features
----------

[](#-features)

- **Blazing Fast**: Image processing runs in an isolated Python process. No more `Allowed memory size exhausted` errors in PHP!
- **Fluent API**: Clean, intuitive, and chainable syntax (`->resize()->watermark()->save()`).
- **Laravel Queues**: Send massive batch jobs to the background instantly with `->queue()`.
- **Cloud Storage (S3)**: Seamlessly pull/push to AWS S3 or Local disks with `->fromDisk()` and `->toDisk()`.
- **Variant Generator**: Automatically spawn `thumbnail`, `medium`, and `large` responsive variants based on config presets.
- **Watermark Engine**: Apply image watermarks with precise CSS-like positioning and alpha opacity.
- **Next-Gen Formats**: Built-in support for converting to WebP and AVIF.

---

📦 Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 10.0, 11.0, or 12.0+
- Python 3+
- Pillow (`pip install Pillow>=10.0.0`)

---

🚀 Installation
--------------

[](#-installation)

1. Require the package via Composer:

```
composer require daiyanmozumder/image-wizard
```

2. Publish the configuration file:

```
php artisan vendor:publish --tag=image-wizard-config
```

3. Ensure you have Python and the Pillow library installed on your server/environment:

```
pip install Pillow
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Open `config/image-wizard.php`. Here you can define default formats, compression quality, queue settings, and responsive variant presets.

```
return [
    'default_format' => 'webp', // Convert everything to webp by default

    'python' => [
        'executable' => env('IMAGE_WIZARD_PYTHON_EXECUTABLE', 'python3'),
        'timeout' => 60, // Maximum execution time in seconds
    ],

    'quality' => [
        'jpeg' => 80,
        'webp' => 80,
        'avif' => 50,
    ],

    'variants' => [
        'thumbnail' => ['width' => 150, 'height' => 150, 'fit' => 'crop'],
        'medium'    => ['width' => 800, 'height' => 800, 'fit' => 'contain'],
        'large'     => ['width' => 1200, 'height' => 1200, 'fit' => 'contain'],
    ],
];
```

---

📖 Usage Guide
-------------

[](#-usage-guide)

### Basic Processing

[](#basic-processing)

Chain commands together effortlessly. Execution is delayed until you call `save()`, allowing for clean architecture.

```
use ImageWizard;

ImageWizard::load('public/uploads/raw.jpg')
    ->resize(800, 600, 'cover')
    ->format('webp')
    ->quality(85)
    ->save('public/images/optimized.webp');
```

### Advanced Resizing (Fit Strategies)

[](#advanced-resizing-fit-strategies)

Pass a fit strategy as the third argument to `resize()` to control how the image scales.

```
ImageWizard::load('image.jpg')
    ->resize(500, 500, 'contain') // (Default) Scale to fit within bounds
    // ->resize(500, 500, 'cover')   // Scale to fill bounds exactly, cropping overflow
    // ->resize(500, 500, 'stretch') // Ignore aspect ratio, force to exact dimensions
    // ->resize(500, 500, 'pad')     // Fit within bounds, adding transparent/white padding
    ->save('output.jpg');
```

### Watermarks

[](#watermarks)

Overlay logos onto your images. You can control opacity, margin, and CSS-like positioning (`bottom-right`, `top-left`, `center`, etc.).

```
ImageWizard::load('photo.jpg')
    ->watermark('logo.png', [
        'position' => 'bottom-right',
        'opacity' => 0.6, // 60% opacity
        'margin' => 20    // 20px offset from the edge
    ])
    ->save('photo-watermarked.jpg');
```

### Cloud Storage (AWS S3)

[](#cloud-storage-aws-s3)

Image Wizard integrates natively with Laravel's `Storage` facade. It automatically streams files from S3 to a local temp folder, processes them via Python, streams them back to S3, and cleans up the temp files.

```
ImageWizard::fromDisk('s3', 'raw-uploads/user.jpg')
    ->resize(1200)
    ->watermark('watermark.png')
    ->toDisk('s3', 'optimized/user.jpg');
```

### Background Processing (Queues)

[](#background-processing-queues)

Processing large 4K images blocks the PHP thread. Use `queue()` to dispatch a background job instantly instead of `save()`.

```
// Instantly returns a response to the user
ImageWizard::load('massive-raw-file.tiff')
    ->format('avif')
    ->resize(2000)
    ->queue('public/optimized.avif');
```

### Automatic Responsive Variants

[](#automatic-responsive-variants)

Instead of manually creating multiple sizes, use your config presets to generate them all at once.

```
ImageWizard::load('hero.png')
    ->generateVariants('public/hero.jpg', ['thumbnail', 'medium', 'large']);
```

This generates:

- `public/hero-thumbnail.jpg`
- `public/hero-medium.jpg`
- `public/hero-large.jpg`

### Batch Processing

[](#batch-processing)

Apply a strict pipeline to an entire array of files.

```
$files = ['img1.jpg', 'img2.png', 'img3.webp'];

ImageWizard::resize(500, 500, 'crop')
    ->format('webp')
    ->batch($files, 'public/batch-output/');
```

### Preserving Metadata (EXIF)

[](#preserving-metadata-exif)

By default, EXIF data (GPS, camera info) is stripped to optimize file size. If you are building a photography portfolio, preserve it easily:

```
ImageWizard::load('photo.jpg')
    ->preserveMetadata()
    ->save('photo-preserved.jpg');
```

---

🛠️ Troubleshooting
------------------

[](#️-troubleshooting)

- **Python execution failed / File not found**: Ensure `python` or `python3` is available in your server's `$PATH`. If using Docker or a specific environment, update the `executable` path in `config/image-wizard.php`.
- **JSON Decode Error**: The PHP bridge expects strict JSON from Python. If you have modified the Python environment to print debug warnings to `stdout`, it will break the bridge. Ensure your Python script runs silently.
- **Missing Pillow**: If you get an internal engine error mentioning `PIL`, run `pip install Pillow` on your host machine.

---

🛡️ Security
-----------

[](#️-security)

If you discover any security related issues, please email `hello@example.com` instead of using the issue tracker.

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0306cc63f1bc4923a2db180a4874181070fa930957dc8b8b032ec89fb4c4f3b9?d=identicon)[MiltonDaiyan](/maintainers/MiltonDaiyan)

---

Top Contributors

[![DaiyanMozumder](https://avatars.githubusercontent.com/u/108240573?v=4)](https://github.com/DaiyanMozumder "DaiyanMozumder (2 commits)")

---

Tags

laravelimageprocessingwatermarkqueuebatchoptimizationpythonpillowWebpavif

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/daiyanmozumder-image-wizard/health.svg)

```
[![Health](https://phpackages.com/badges/daiyanmozumder-image-wizard/health.svg)](https://phpackages.com/packages/daiyanmozumder-image-wizard)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M280](/packages/laravel-horizon)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

43140.3k](/packages/harris21-laravel-fuse)[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)

PHPackages © 2026

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