PHPackages                             ninjaimg/php-sdk - 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. ninjaimg/php-sdk

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

ninjaimg/php-sdk
================

NinjaImg PHP SDK.

30.4(2y ago)1247MITPHP

Since Nov 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/skipperbent/ninjaimg-php-sdk)[ Packagist](https://packagist.org/packages/ninjaimg/php-sdk)[ Docs](https://ninjaimg.com)[ RSS](/packages/ninjaimg-php-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (35)Used By (0)

ninjaimg/php-sdk
================

[](#ninjaimgphp-sdk)

Official PHP SDK for the NinjaImg service

Installing the SDK
------------------

[](#installing-the-sdk)

Add the latest version of the NinjaImg SDK by running the following command:

```
composer require ninjaimg/php-sdk

```

Uploading file
--------------

[](#uploading-file)

```
$image = new \NinjaImg\NinjaUpload($ninjaImgDomain, $ninjaImgApiToken);
$content = file_get_contents('/path/to/my/image.jpg');
$newUrl = $image->upload($content, '/destination/path/file.jpg');
```

Deleting file
-------------

[](#deleting-file)

```
$image = new \NinjaImg\NinjaUpload($ninjaImgDomain, $ninjaImgApiToken);
$response = $image->delete('/destination/path/file.jpg');
```

Deleting multiple files
-----------------------

[](#deleting-multiple-files)

```
$image = new \NinjaImg\NinjaUpload($ninjaImgDomain, $ninjaImgApiToken);
$response = $image->deleteBatch([
    '/destination/path/file1.jpg',
    '/destination/path/file2.jpg',
]);
```

Generating url
--------------

[](#generating-url)

```
$url = new \NinjaImg\NinjaImage('http://example.ninjaimg.com/destination/path/file.jpg');

return $url->height(200)->width(200)->getUrl();
```

Generating text
---------------

[](#generating-text)

```
$text = new \NinjaImg\NinjaText('example.ninjaimg.com');
$text->text('Hello world');

return $text->textFont('Arial')->getUrl();
```

#### Response

[](#response)

```
//example.ninjaimg.com/destination/path/file.jpg?h=200&w=200

```

The MIT License (MIT)
---------------------

[](#the-mit-license-mit)

Copyright (c) 2016 ninjaimg.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~90 days

Recently: every ~42 days

Total

32

Last Release

1008d ago

Major Versions

1.0.4 → 2.0.02016-01-20

2.5.5 → 3.0.02023-02-20

3.0.4 → 30.42023-08-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dab716ac4ac16ea3e01400efe43853b43821b33b8c601c2c772689d58cebf3c?d=identicon)[sessingo](/maintainers/sessingo)

---

Top Contributors

[![skipperbent](https://avatars.githubusercontent.com/u/634762?v=4)](https://github.com/skipperbent "skipperbent (90 commits)")[![Frozire](https://avatars.githubusercontent.com/u/6813614?v=4)](https://github.com/Frozire "Frozire (1 commits)")

---

Tags

imageimagesimage resizephp-sdkdropboxresizingamazon-s3image resizerimage handlerimagehandlerninjaimgupload apininja-image

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ninjaimg-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/ninjaimg-php-sdk/health.svg)](https://phpackages.com/packages/ninjaimg-php-sdk)
```

###  Alternatives

[ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

103548.4k1](/packages/ctessier-nova-advanced-image-field)[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[andrewgjohnson/imagettftextblur

imagettftextblur is a drop in replacement for imagettftext with added parameters to add blur, glow and shadow effects to your PHP GD images

27198.4k1](/packages/andrewgjohnson-imagettftextblur)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)[toinekamps/responsive-pics

Responsive Pics is a Wordpress tool for resizing images on the fly.

831.2k](/packages/toinekamps-responsive-pics)[michaeld555/filament-croppie

Croppie Js Implementation Field for Filament forms

123.1k](/packages/michaeld555-filament-croppie)

PHPackages © 2026

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