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(4mo ago)221MITPHPPHP ^8.2

Since Feb 21Pushed 4mo 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 today

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

37

—

LowBetter than 81% of packages

Maintenance76

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

132d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50880252?v=4)[chocoway](/maintainers/chocoway)[@chocoway](https://github.com/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.6k53.3M146](/packages/league-glide)[intervention/image-laravel

Laravel Integration of Intervention Image

1588.9M181](/packages/intervention-image-laravel)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

506516.3k29](/packages/bkwld-croppa)[laravel-at/laravel-image-sanitize

A small but handy package to prevent malicious code execution coming into your application through uploaded image files.

33866.8k](/packages/laravel-at-laravel-image-sanitize)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)

PHPackages © 2026

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