An open API service indexing awesome lists of open source software.

https://github.com/jaysalvat/image2css

Pointless PHP class to convert image to CSS box-shadow property.
https://github.com/jaysalvat/image2css

Last synced: 5 months ago
JSON representation

Pointless PHP class to convert image to CSS box-shadow property.

Awesome Lists containing this project

README

          

# Pointless Image To CSS Converter

[![Latest Stable Version](https://poser.pugx.org/jaysalvat/image2css/v/stable.svg)](https://packagist.org/packages/jaysalvat/image2css)
[![License](https://poser.pugx.org/jaysalvat/image2css/license.svg)](https://packagist.org/packages/jaysalvat/image2css)

You suck at CSS but want to impress your friends anyway?
This PHP class converts an image to thousands of CSS lines of box-shadow properties. It's totally pointless... but life is pointless...

## Demo:

You can see a demonstration on [CodePen.io](http://codepen.io/jaysalvat/pen/HaqBf).

http://codepen.io/jaysalvat/pen/HaqBf

## Installation:

Create a [composer.json](https://getcomposer.org/) file with:

{
"require": {
"jaysalvat/image2css": "~1.0"
}
}

And run [Composer](https://getcomposer.org/) to install Image2Css.

$ curl -sS https://getcomposer.org/installer | php
$ composer.phar install

## Example:

$img = new \Image2Css\Converter("monalisa.jpg");
$img->setWidth(200);
$img->setPixelSize(4);
$img->setBlur(4);

echo $img->computeStyle();

## Note:

GD extension required.

http://www.php.net/manual/en/book.image.php