Image placeholder provider for Faker
A high-performance placeholder image generator with full test coverage and no network requests to third-party services.
Install this Faker provider using Composer:
composer require niklasbr/quick-magick
use Faker\Factory;
use NiklasBr\QuickMagick\QuickMagick;
$faker = Factory::create();
$faker->addProvider(new QuickMagick($faker));
// Simple image with only default parameters
$imageData = $faker->image();
// A linear gradient
$imageData = $faker->image(category: Type::LINEAR_GRADIENT, word: '#1100ff-magenta');
// A radial gradient
$imageData = $faker->image(category: Type::RADIAL_GRADIENT, word: 'green-yellow');
// A plasma with fractal colour
$imageData = $faker->image(category: Type::PLASMA, word: 'fractal-magenta');
// A black and white pattern
$imageData = $faker->image(category: Type::PATTERN, imagickArgs: 'SMALLFISHSCALES');
This package is available under two licenses:
-
Affero GPL Version 3, 19 November 2007, this is the default license.
-
BSD-3.0 via commercial agreement which also includes a limited warranty and fitness-for-purpose promise, available upon donation to charity.