PHPackages                             peterujah/nano-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. peterujah/nano-image

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

peterujah/nano-image
====================

NanoImage is a simple php image resize class.

2.1.3(1y ago)479MITPHPPHP ^7.0 || ^8.0

Since Dec 14Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)DependenciesVersions (15)Used By (0)

Nano Image
----------

[](#nano-image)

NanoImage is a simple PHP image resize class. It can resize images and display them in the browser or save images in a directory

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

[](#installation)

Installation is super-easy via Composer:

```
composer require peterujah/nano-image
```

Basic Usage
-----------

[](#basic-usage)

```
$image = new NanoImage();
try{
  $image = $imagine->open("path/to/save/edit-image-size.jpg");

  $image->resize(360, 200, false);
  $image->save("path/to/save/new-image.jpg", NanoImage::THUMBNAIL, 80);

  $image->resize(116, 80, false);
  $image->saveAs("path/to/save/new-image.jpeg", NanoImage::THUMBNAIL, 100, NanoImage::JPEG);

  $image->free();
}catch(UnsupportedImageException $e){
  echo $e->getMessage();
}
```

---

**Applying Filters**

```
$image = new NanoImage();
$image->filter(IMG_FILTER_GRAYSCALE)
      ->filter(IMG_FILTER_BRIGHTNESS, 30)
      ->get(90);
```

Or:

```
$image->filters([
    [IMG_FILTER_CONTRAST, -50],
    [IMG_FILTER_COLORIZE, 100, 50, 0], // Add color overlay
])->get();
```

---

```
$img = new Peterujah\NanoBlock\NanoImage();
```

Initialize nano image class for use

Open and load any image from a directory path &amp; file name

```
$img->open(__DIR__ . "/path/to/assets/image.jpg");
```

Or load string containing the image data.

```
$img->load($image_data);
```

Resize an image with the exact width and height passed, for example, 200x200. To resize an image using the aspect ratio set the third parameter to true

```
$img->resize(200, 200, false||true);
```

Blur image

```
$img->blur(20);
```

Once image manipulation is done, display the output image on the browser. Pass quality of the image

```
$img->display($quality);
```

Save an image to a directory, the first parameter specifies the path, the second sets the image naming option, and the third is image quality (90 by default)

```
$img->save(__DIR__ . "/path/to/assets/new-image.jpg", NanoImage::DEFAULT, $quality);
```

Save image as

```
$img->saveAs($to,  NanoImage::DEFAULT || NanoImage::THUMBNAIL || NanoImage::TIMESTAMP, $quality, self::JPEG)
```

Replace the existing image with a new one

```
$img->replace($to, $quality)
```

Remove temp image after editing and free memory

```
$img->remove()
```

Free memory

```
$img->free()
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance70

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~91 days

Recently: every ~70 days

Total

14

Last Release

431d ago

Major Versions

0.1 → 1.22022-04-29

1.9 → 2.0.02024-05-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce34af529a4ed50696211a2b4d330fbadd2d1738bc5d010523eb4a85cf342b17?d=identicon)[peterujah](/maintainers/peterujah)

---

Top Contributors

[![peterujah](https://avatars.githubusercontent.com/u/16369609?v=4)](https://github.com/peterujah "peterujah (67 commits)")

---

Tags

phpimageimage libphp imageedit image

### Embed Badge

![Health badge](/badges/peterujah-nano-image/health.svg)

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

###  Alternatives

[stefangabos/zebra_image

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

141110.4k6](/packages/stefangabos-zebra-image)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[lciolecki/php-image-optimizer

PHP image file optimizer (uses https://github.com/bensquire/php-image-optim)

347.4k](/packages/lciolecki-php-image-optimizer)

PHPackages © 2026

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