PHPackages                             open20/yii2-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. open20/yii2-image

ActiveYii2-extension[Image &amp; Media](/categories/media)

open20/yii2-image
=================

Yii2 extension for image manipulating using Kohana Image Library.

1.0.1(1y ago)01.9k↓30.8%12BSD-3-ClausePHPPHP &gt;=5.4.0

Since Nov 22Pushed 1y agoCompare

[ Source](https://github.com/EliteDivision/yii2-image)[ Packagist](https://packagist.org/packages/open20/yii2-image)[ Docs](https://github.com/yurkinx/yii2-image)[ RSS](/packages/open20-yii2-image/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (2)

yii2-image
==========

[](#yii2-image)

Simple to use Yii2 Framework extension for image manipulating using powerful Kohana Image Library. Inspired by old yii extension  and Kohana Image Library

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

[](#installation)

**Install as a [composer package](https://packagist.org/packages/yurkinx/yii2-image)**

> Use this method to get continuous updates.

```
composer require yurkinx/yii2-image

```

or include the dependency in the `composer.json` file:

```
{
    "require": {
        "yurkinx/yii2-image": "^1.2"

    }
}
```

Configuration
-------------

[](#configuration)

In config file

```
/config/web.php

```

Add image component

```
'components' => array(
        ...
        'image' => array(
        	 	'class' => 'yii\image\ImageDriver',
        		'driver' => 'GD',  //GD or Imagick
        		),
		    )

```

Usage
-----

[](#usage)

```
$file=Yii::getAlias('@app/pass/to/file');
$image=Yii::$app->image->load($file);
header("Content-Type: image/png");
echo 	$image->resize($width,$height)->rotate(30)->render();
```

Supported methods out of the box from Kohana Image Library:

```
$image->resize($width = NULL, $height = NULL, $master = NULL);
$image->crop($width, $height, $offset_x = NULL, $offset_y = NULL);
$image->sharpen($amount);
$image->rotate($degrees);
$image->save($file = NULL, $quality = 100);
$image->render($type = NULL, $quality = 100);
$image->reflection($height = NULL, $opacity = 100, $fade_in = FALSE);
$image->flip($direction);
$image->background($color, $opacity = 100);
$image->watermark(Image $watermark, $offset_x = NULL, $offset_y = NULL, $opacity = 100);
```

**Using resize with resize constrains**

```
$image->resize($width, $height, \yii\image\drivers\Image::HEIGHT);
$image->resize($width, $height, \yii\image\drivers\Image::ADAPT)->background('#fff');
```

**Using resize with resize constrains and best quality output image \[for Imagick driver only\]**

Use 1 for best speed and lower quality, 100 for best quality and lower speed. Only values 1,100 currently supported

```
$image->resize($width, NULL, \yii\image\drivers\Image::WIDTH, 100);
```

Possible resize constrains:

```
// Resizing constraints ($master)
    const NONE    = 0x01;
    const WIDTH   = 0x02;
    const HEIGHT  = 0x03;
    const AUTO    = 0x04;
    const INVERSE = 0x05;
    const PRECISE = 0x06;
    const ADAPT   = 0x07;
    const CROP    = 0x08;
```

**Using flip with flipping directions**

```
// Flipping directions ($direction)
$image->flip(\yii\image\drivers\Image::HORIZONTAL);
```

Possible flipping directions:

```
     const HORIZONTAL = 0x11;
     const VERTICAL   = 0x12;
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance44

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 51.4% 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 ~104 days

Total

2

Last Release

439d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6eb97765ff9c2a6c83df362376ac9fe8f21e4ac4c3b65fd1e2380233178fe500?d=identicon)[open2.0](/maintainers/open2.0)

---

Top Contributors

[![yurkinx](https://avatars.githubusercontent.com/u/1325711?v=4)](https://github.com/yurkinx "yurkinx (18 commits)")[![mervick](https://avatars.githubusercontent.com/u/2429298?v=4)](https://github.com/mervick "mervick (7 commits)")[![giuseppealtomonte](https://avatars.githubusercontent.com/u/11960163?v=4)](https://github.com/giuseppealtomonte "giuseppealtomonte (4 commits)")[![Pfarrer](https://avatars.githubusercontent.com/u/3874162?v=4)](https://github.com/Pfarrer "Pfarrer (3 commits)")[![coderfly](https://avatars.githubusercontent.com/u/160787?v=4)](https://github.com/coderfly "coderfly (1 commits)")[![michelezucchini](https://avatars.githubusercontent.com/u/13572596?v=4)](https://github.com/michelezucchini "michelezucchini (1 commits)")[![fschindler](https://avatars.githubusercontent.com/u/5937990?v=4)](https://github.com/fschindler "fschindler (1 commits)")

---

Tags

imageyii2extension

### Embed Badge

![Health badge](/badges/open20-yii2-image/health.svg)

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

###  Alternatives

[yurkinx/yii2-image

Yii2 extension for image manipulating using Kohana Image Library.

66412.9k9](/packages/yurkinx-yii2-image)[raoul2000/yii2-jcrop-widget

This extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

10248.3k2](/packages/raoul2000-yii2-jcrop-widget)[noam148/yii2-image-resize

A Yii2 component for resizing images (on the fly)

1144.6k7](/packages/noam148-yii2-image-resize)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

1020.8k](/packages/maxmirazh33-yii2-uploadable-cropable-image)

PHPackages © 2026

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