PHPackages                             chocoway/moonshine-compressed-image - 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. chocoway/moonshine-compressed-image

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

chocoway/moonshine-compressed-image
===================================

Compressed Image field for MoonShine

v1.0.0(2mo ago)219MITPHPPHP ^8.2

Since Feb 21Pushed 2mo agoCompare

[ Source](https://github.com/chocoway/moonshine-compressed-image)[ Packagist](https://packagist.org/packages/chocoway/moonshine-compressed-image)[ RSS](/packages/chocoway-moonshine-compressed-image/feed)WikiDiscussions main Synced 1mo ago

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

MoonShine Compressed Image
==========================

[](#moonshine-compressed-image)

A custom image field for [MoonShine](https://getmoonshine.app) admin panel with built-in image compression, resizing, thumbnail generation and format conversion powered by [Intervention Image v3](https://image.intervention.io/v3).

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10|11|12
- MoonShine 4.x
- GD extension

Installation
------------

[](#installation)

```
composer require chocoway/moonshine-compressed-image
```

Usage
-----

[](#usage)

```
use Chocoway\MoonshineCompressedImage\Fields\CompressedImage;

CompressedImage::make('Photo', 'photo')
    ->width(1000)
    ->height(800)
    ->aspectRatio()
    ->format('webp')
    ->quality(80)
    ->thumb(200, 200)
```

Available Methods
-----------------

[](#available-methods)

MethodDescription`->width(int $width)`Set max width in pixels`->height(int $height)`Set max height in pixels`->aspectRatio()`Keep aspect ratio when resizing`->format(string $format)`Output format: `jpg`, `png`, `webp`, `gif``->quality(int $quality)`Compression quality from 1 to 100 (default: 80)`->thumb(int $width, int $height)`Generate a thumbnail alongside the originalExamples
--------

[](#examples)

**Resize with aspect ratio (recommended):**

```
CompressedImage::make('Photo', 'photo')
    ->width(1000)
    ->aspectRatio()
    ->format('webp')
    ->quality(80)
```

**With thumbnail:**

```
CompressedImage::make('Photo', 'photo')
    ->width(1000)
    ->aspectRatio()
    ->format('webp')
    ->quality(80)
    ->thumb(200, 200)
```

Thumbnail is saved alongside the original with a `thumb_` prefix:

- Original: `images/photo.webp`
- Thumbnail: `images/thumb_photo.webp`

**Convert to WebP without resizing:**

```
CompressedImage::make('Photo', 'photo')
    ->format('webp')
    ->quality(75)
```

**Strict resize to exact dimensions:**

```
CompressedImage::make('Photo', 'photo')
    ->width(1000)
    ->height(500)
    ->format('jpg')
    ->quality(90)
```

Compatibility
-------------

[](#compatibility)

`CompressedImage` extends the standard MoonShine `Image` field, so all built-in `File` and `Image` methods are fully supported:

```
CompressedImage::make('Photo', 'photo')
    ->width(1000)
    ->format('webp')
    ->quality(80)
    ->disk('s3')               // custom filesystem disk
    ->dir('uploads/photos')    // storage subdirectory
    ->multiple()               // upload multiple images
    ->removable()              // allow deleting images
    ->keepOriginalFileName()   // preserve original filename
```

See the MoonShine docs for the full list of available [File](https://getmoonshine.app/en/docs/4.x/fields/file) and [Image](https://getmoonshine.app/en/docs/4.x/fields/image) methods.

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance84

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

86d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44f0469349773a918dbaa42d2444d4680ff56ceb5cda07c0e20061cf36a04b1a?d=identicon)[chocoway](/maintainers/chocoway)

---

Top Contributors

[![chocoway](https://avatars.githubusercontent.com/u/50880252?v=4)](https://github.com/chocoway "chocoway (17 commits)")

### Embed Badge

![Health badge](/badges/chocoway-moonshine-compressed-image/health.svg)

```
[![Health](https://phpackages.com/badges/chocoway-moonshine-compressed-image/health.svg)](https://phpackages.com/packages/chocoway-moonshine-compressed-image)
```

###  Alternatives

[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[jenssegers/imagehash

Perceptual image hashing for PHP

2.1k2.2M5](/packages/jenssegers-imagehash)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[rtippin/messenger

Laravel messenger suite.

45035.8k4](/packages/rtippin-messenger)

PHPackages © 2026

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