PHPackages                             ideatic/tinyfier - 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. ideatic/tinyfier

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

ideatic/tinyfier
================

Complete suite for compressing, preprocessing, and optimizing HTML/Javascript/CSS and Images.

v1.3(1y ago)103.3k3MITPHPPHP &gt;=8

Since Apr 5Pushed 1y ago3 watchersCompare

[ Source](https://github.com/ideatic/tinyfier)[ Packagist](https://packagist.org/packages/ideatic/tinyfier)[ Docs](http://www.tinyfier.com)[ RSS](/packages/ideatic-tinyfier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Tinyfier
========

[](#tinyfier)

####

[](#httpwwwtinyfiercom)

`Tinyfier` is a complete suite for compressing, preprocessing, and optimizing HTML/Javascript/CSS and Images.

### Usage

[](#usage)

#### Optimization on-the-fly (assets\_loader)

[](#optimization-on-the-fly-assets_loader)

With `Tinyfier` you can combine multiple CSS or Javascript files, add extra functionality to CSS (using LESS), remove unnecessary whitespace and comments, and serve them with gzip encoding and optimal client-side cache headers.

For compress and combine your javascript and stylesheets files, all that you need to do is replace the original URL:

>

By this:

>

You can also join multiple files into a larger one, reducing the number of HTTP request and making your application fly!

>

Also, if you want to pass extra variables to CSS parser, you can do it by adding it into the URL, for example:

> [http://example.com/static/tinyfier/tinyfier.php/stylesheet.css,base\_color=%23ff0000](http://example.com/static/tinyfier/tinyfier.php/stylesheet.css,base_color=%23ff0000)

### Javascript

[](#javascript)

`Tinyfier` uses the Google Closure service to compile and minimize Javascript, and, if not available, rely on JSMinPlus for that operation.

### CSS

[](#css)

For CSS files, `Tinyfier` uses the [lessphp parser by `leafo`](http://leafo.net/lessphp/) for add extra functionality to css files. This include variables, mixins, expressions, nested blocks, etc. You can see all the available commands in [lessphp documentation](http://leafo.net/lessphp/docs/). Also, the generated css code is optimized, compressed and the CSS3 vendor prefix (like -*webkit* or *-moz*) are added, using [css\_optimizer](https://github.com/javiermarinros/css_optimizer).

Also, Tinyfier adds even more functionality:

#### Sprites

[](#sprites)

With Tinyfier, create a css sprite it's easy and intuitive. All that you need to do use the function `sprite` where the first argument is the image path (relative to the document) and the second the name of the sprite. E.g.:

> ```
> .login {
>     background: sprite('images/user_go.png', 'user') no-repeat;
> }
>
> .logout {
>     background: sprite('images/user_delete.png', 'user') no-repeat;
> }
>
> ```

#### Gradient generator

[](#gradient-generator)

Tinyfier include tools to generate CSS3-compatible gradients with backward compatibility with old browsers (through the generation of the equivalent images).

> ```
> header {
>     background: gradient('vertical', @header_start_color, @header_middle_color 50%, @header_end_color, 1px, 200px);
> }
>
> ```

(Remember that with lessphp you can use variables everywhere in your code!)

#### Image embedding

[](#image-embedding)

You can also embed images in the document (using the [Data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme)) with the command `inline`.

> ```
> #gplus {
>    background: inline('images/social/gplus.png');
> }
>
> ```

#### Image filters

[](#image-filters)

Another cool function of `Tinyfier` is the ability for work with image filters.

> ```
> #lion:hover {
>    background: filter('images/lion.jpg', 'brightness', 50%);
> }
>
> ```

Internally, `Tinyfier` uses the php function [imagefilter](http://www.php.net/manual/function.imagefilter.php), so you can use all the filters available for it (negate, grayscale, brightness, blur, pixelate and more).

#### Resize images

[](#resize-images)

If you have to show your image or sprite in differents size, it's as easy as use:

> ```
> #lion:hover {
>    background: resize('images/lion.jpg', 50%);
> }
>
> ```

The filter `resize` can take up to 4 arguments: image url, width (in either px or %), height, and a boolean value than enables or disables aspect ratio (true / false)

#### More

[](#more)

Please, look in the test file for more examples for using Tinyfier in your project. It's really easy!

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance49

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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 ~829 days

Total

5

Last Release

377d ago

PHP version history (2 changes)v1.0.1PHP &gt;=5.2

v1.1PHP &gt;=8

### Community

Maintainers

![](https://www.gravatar.com/avatar/260931d3c35a4ad227b44452f05ce6f4993ed604f3748064e14eac8764a8d8a8?d=identicon)[ideatic](/maintainers/ideatic)

---

Top Contributors

[![javiermarinros](https://avatars.githubusercontent.com/u/840412?v=4)](https://github.com/javiermarinros "javiermarinros (52 commits)")[![Dazag](https://avatars.githubusercontent.com/u/1424832?v=4)](https://github.com/Dazag "Dazag (2 commits)")

---

Tags

cssimageJShtmlminifyoptimizationminification

### Embed Badge

![Health badge](/badges/ideatic-tinyfier/health.svg)

```
[![Health](https://phpackages.com/badges/ideatic-tinyfier/health.svg)](https://phpackages.com/packages/ideatic-tinyfier)
```

###  Alternatives

[ps/image-optimizer

Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

9341.7M25](/packages/ps-image-optimizer)[middlewares/minifier

Middleware to minify Html, CSS and Javascript responses

1729.1k2](/packages/middlewares-minifier)

PHPackages © 2026

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