PHPackages                             cinghie/yii2-tinify - 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. cinghie/yii2-tinify

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

cinghie/yii2-tinify
===================

Yii2 integration for TinyPng

1.0.2(3y ago)31.2k1BSD-3-ClausePHP

Since Nov 6Pushed 3y ago2 watchersCompare

[ Source](https://github.com/cinghie/yii2-tinify)[ Packagist](https://packagist.org/packages/cinghie/yii2-tinify)[ Docs](https://github.com/cinghie/yii2-tinify)[ RSS](/packages/cinghie-yii2-tinify/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Yii2 Tinify
===========

[](#yii2-tinify)

[![License](https://camo.githubusercontent.com/48f30630d5facad1f3e2cb9f59f3f2c838b7f1e4480bd59595d294998105ad09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d74696e6966792e737667)](https://camo.githubusercontent.com/48f30630d5facad1f3e2cb9f59f3f2c838b7f1e4480bd59595d294998105ad09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d74696e6966792e737667)[![Latest Stable Version](https://camo.githubusercontent.com/42203796b7ffdc5527a997cb0e1328ba65d8bd77ddad7644d248f8fbca16a12f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d74696e6966792e737667)](https://camo.githubusercontent.com/42203796b7ffdc5527a997cb0e1328ba65d8bd77ddad7644d248f8fbca16a12f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d74696e6966792e737667)[![Latest Release Date](https://camo.githubusercontent.com/28802ed8f5f3c822aba96169326cdf605b24e3d17131f434d26ef56f19b300c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d74696e6966792e737667)](https://camo.githubusercontent.com/28802ed8f5f3c822aba96169326cdf605b24e3d17131f434d26ef56f19b300c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d74696e6966792e737667)[![Latest Commit](https://camo.githubusercontent.com/024a6cb230bd4b969ee262abaeefcca96bd38aee6932d1742021de0295570c3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d74696e6966792e737667)](https://camo.githubusercontent.com/024a6cb230bd4b969ee262abaeefcca96bd38aee6932d1742021de0295570c3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d74696e6966792e737667)[![Total Downloads](https://camo.githubusercontent.com/1fcb0b0a6a3dc8f1a077fe9d60c31250dd3ee1fbfd09ab4fcae5b148d9a9130a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63696e676869652f796969322d74696e6966792e737667)](https://packagist.org/packages/cinghie/yii2-tinify)

Yii2 integration for TinyPng:

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require cinghie/yii2-tinify "^1.0.2"

```

or add this line to the require section of your `composer.json` file.

```
"cinghie/yii2-tinify": "^1.0.2"

```

Usage
-----

[](#usage)

Initialize component:

```
$tinify = new Tinify(['apiKey' => 'YOUR API KEY']);

```

Compress image from Path: )

```
// create a new image
$tinify->compress('path/to/file/to/compress','path/to/file/after/compression');
// overwrite file
$tinify->compress('path/to/file/to/compress');

```

Compress image from Buffer: )

```
$tinify->compressFromBuffer('path/to/file/to/compress');

```

Compress image from Url: )

```
$tinify->compressFromUrl('https://tinypng.com/images/panda-happy.png','path/to/file/after/compression');

```

Resize image:

```
// create a new image
$tinify->resize('path/to/file/to/compress','path/to/file/after/compression',['method' => 'fit', 'width' => 150, 'height' => 100]);
// overwrite file
$tinify->resize('path/to/file/to/compress',null,['method' => 'fit', 'width' => 150, 'height' => 100]);
// Available methods
scale,fit,cover,thumb

```

Store image to Amazon S3:

```
$tinify = new Tinify([
	'apiKey' => 'YOUR API KEY',
	'aws_access_key_id' => 'YOUR_AWS_ID_KEY',
	'aws_secret_access_key' => 'YOUR_AWS_ACCESS_KEY',
	'headers' => array('Cache-Control' => 'max-age=31536000, public'),
	'path' => 'example-bucket/my-images/optimized.jpg',
	'region' => 'us-west-1'
]);
$tinify->storeToAmazonS3('path/to/file/to/compress');

```

Compressions used this month:

```
$count = $tinify->usage();

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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 ~807 days

Total

3

Last Release

1181d ago

### Community

Maintainers

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

---

Top Contributors

[![cinghie](https://avatars.githubusercontent.com/u/2445152?v=4)](https://github.com/cinghie "cinghie (18 commits)")

---

Tags

yii2yii2 tinypngyii2 tinifyyii2 optimizationyii2 compressionyii2 image compressionyii2 image optimization

### Embed Badge

![Health badge](/badges/cinghie-yii2-tinify/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[trntv/yii2-glide

Yii2 Glide Extension

43276.3k9](/packages/trntv-yii2-glide)[developit/yii2-jcrop

 yii2 image cropping extension

101.5k](/packages/developit-yii2-jcrop)

PHPackages © 2026

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