Skip to content

NiklasBr/quick-magick

Repository files navigation

Image placeholder provider for Faker

A high-performance placeholder image generator with full test coverage and no network requests to third-party services.

Coverage PHPStan Dependabot

Installation

Install this Faker provider using Composer:

composer require niklasbr/quick-magick

Example usage

use Faker\Factory;
use NiklasBr\QuickMagick\QuickMagick;

$faker = Factory::create();
$faker->addProvider(new QuickMagick($faker));
// Simple image with only default parameters
$imageData = $faker->image();

default_output.png

// A linear gradient
$imageData = $faker->image(category: Type::LINEAR_GRADIENT, word: '#1100ff-magenta');

linear_gradient.png

// A radial gradient
$imageData = $faker->image(category: Type::RADIAL_GRADIENT, word: 'green-yellow');

linear_gradient.png

// A plasma with fractal colour
$imageData = $faker->image(category: Type::PLASMA, word: 'fractal-magenta');

linear_gradient.png

// A black and white pattern
$imageData = $faker->image(category: Type::PATTERN, imagickArgs: 'SMALLFISHSCALES');

linear_gradient.png

License

This package is available under two licenses:

About

Image placeholder provider for Faker

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages