PHPackages                             efrontsa/images-generator - 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. efrontsa/images-generator

ActiveLibrary

efrontsa/images-generator
=========================

Generator of placeholder images for Faker

1.0.1(10y ago)0645MITPHPPHP &gt;=5.3.0

Since Oct 6Pushed 4y agoCompare

[ Source](https://github.com/efrontsa/images-generator)[ Packagist](https://packagist.org/packages/efrontsa/images-generator)[ Docs](https://github.com/bruceheller/images-generator)[ RSS](/packages/efrontsa-images-generator/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

images-generator
================

[](#images-generator)

Generator of placeholder-type images using **GD** for **[fzaninotto/Faker](https://github.com/fzaninotto/Faker)**

[![Sample image](https://cloud.githubusercontent.com/assets/3966713/10469009/a205715e-7202-11e5-8603-cdcf2191c5e1.png)](https://cloud.githubusercontent.com/assets/3966713/10469009/a205715e-7202-11e5-8603-cdcf2191c5e1.png)

[![Build Status](https://camo.githubusercontent.com/d9f22a8c635122cda6947d5e10830377ba58b9624784e8f799a28657474e4df2/68747470733a2f2f7472617669732d63692e6f72672f627275636568656c6c65722f696d616765732d67656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bruceheller/images-generator)

What is the goal of this project?
---------------------------------

[](#what-is-the-goal-of-this-project)

[Faker](https://github.com/fzaninotto/Faker) is an amazing tool to quickly generate bunch of fake data that looks real. You can refer to its documentation to learn more about the powerful things it can do.

One of the great option of [Faker](https://github.com/fzaninotto/Faker) is to be able to use [LoremPixel](http://lorempixel.com/) to get pretty pictures. It works great but has a few drawbacks:

- By using an external source of data, image generation needs to be done on a connected environment. It might be ok for most usage, but can be a problem if you need to generate data on the go or somewhere not connected to the internet.
- Also, because of the same reason, getting a lot of pictures can take a very loooong time as it downloads every picture. If you want to fill your data with hundreds of pictures, it might be problematic.
- Finally, [LoremPixel](http://lorempixel.com/) only generates JPEG pictures, that can takes a large amount of storage.

**images-generator** comes in order to solve this problem. All pictures are directly generated by your current PHP setup using GD, the almost standard for image manipulation in PHP.

**images-generator** can gets very useful for unit tests, integration servers, fixtures and many other cases...

Advantages of using **images-generator**:

- **Fast image generation**
- **No need of internet connection**
- **Can generate both JPEG and PNG pictures**

Drawbacks of using **images-generator**:

- Can't generate realistic pictures: That would be more complex to do (and slower). If you need real content, the only option for now is to stick with **LoremPixel** content.

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

[](#installation)

The easiest way is to use composer:

```
composer require bheller/images-generator

```

Or if you prefer by modifying your composer.json file, add this line to the "require" section:

```
"bheller/images-generator": "~1.0"

```

Usage
-----

[](#usage)

Use the `ImagesGeneratorProvider` class in combinaison with [Faker](https://github.com/fzaninotto/Faker) to produce new images:

```
