This document explains how to use QuickMagick’s public methods and what the main input arguments mean. The sections below describe the most commonly used arguments across those methods.
QuickMagick is intended to be used as a Faker provider. Register new QuickMagick($faker) with Faker once, and the generated examples below assume the provider is already available on $faker.
diris the target directory where generated image files are written. If omitted, QuickMagick defaults to the system temporary directory.filePathis the explicit destination path for the generated image. Use this when you need full control over the output filename.
Methods using dir include image(), randomSolidColor(), randomGradient(), randomPattern(), randomPlasma(), and randomImage().
These arguments define the output image dimensions in pixels. Every public image generation method accepts both width and height.
widthcontrols the horizontal size.heightcontrols the vertical size.
Use smaller values for lightweight placeholder images and larger values for high-resolution examples.
The category argument controls the image type and the pseudo-image syntax used by ImageMagick.
QuickMagick accepts:
- a
Categoryenum value likeCategory::LINEAR_GRADIENT - an enum name like
'LINEAR_GRADIENT' - a category string value like
'gradient'
Supported categories include:
Category::SOLID_COLORCategory::LINEAR_GRADIENTCategory::RADIAL_GRADIENTCategory::PATTERNCategory::PLASMACategory::LABELCategory::CAPTION
If category is omitted, it defaults to Category::SOLID_COLOR.
The word argument is category-specific and supplies the core pseudo-image parameter.
Category::SOLID_COLOR— a single color such as#2E86AB.Category::LINEAR_GRADIENTandCategory::RADIAL_GRADIENT— a color pair separated by a hyphen, e.g.#667EEA-#764BA2.Category::PATTERN— a pattern token such asCROSSHATCH30orSMALLFISHSCALES.Category::PLASMA— an optional seed color like#FF006E; omittingwordproduces a random plasma.Category::LABELandCategory::CAPTION— plain text to render in the image.
ImageMagick supports many color notations, including #f09, #FFBBEE01, rgb(255,0,153), rgba(123,123,123,0.1), and hsl(80,10%,42%).
The gray argument is a boolean flag available on image(), imageData(), and createImageFile().
When true, the generated image is converted to grayscale after rendering.
The format argument controls the output image format.
Supported formats are defined in NiklasBr\QuickMagick\Enums\Format:
Format::PNGFormat::JPEGFormat::GIFFormat::WEBPFormat::TIFFFormat::BMP
Use these constants to ensure consistent output across your calls.
These arguments apply to image():
fullPathdetermines whether the method returns the full path (true) or just the file name (false).randomizecontrols whether the generated filename is unique. Set it tofalsefor stable names, ortrueto avoid collisions.
QuickMagick also exposes convenience methods for generating random placeholder content:
randomSolidColor()randomGradient()randomPattern()randomPlasma()randomImage()
These methods accept dir, width, height, and format, and they generate images without requiring you to provide a category or word value.
This file lists the arguments used to generate each example image with QuickMagick.
Solid color canvas - A simple teal blue background
| Preview | Generation |
![]() | |
Linear gradient - Purple to indigo vertical transition
| Preview | Generation |
![]() | |
Linear gradient - Pink to coral vertical transition
| Preview | Generation |
![]() | |
Linear gradient - Sky blue to cyan vertical transition
| Preview | Generation |
![]() | |
Radial gradient - Red to golden yellow circular transition
| Preview | Generation |
![]() | |
Radial gradient - Mint to peachy circular transition
| Preview | Generation |
![]() | |
Plasma effect - Electric blue fractal pattern
| Preview | Generation |
![]() | |
Plasma effect - Bold magenta to orange fractal
| Preview | Generation |
![]() | |
Pattern - Crosshatch texture
| Preview | Generation |
![]() | |
Pattern - Small fish scales texture
| Preview | Generation |
![]() | |
Label - Simple text rendering on solid background
| Preview | Generation |
![]() | |
Caption - Auto-wrapped multi-line text
Random pattern - Procedurally generated texture pattern
| Preview | Generation |
![]() | |
Random gradient - Procedurally generated color gradient
| Preview | Generation |
![]() | |
Random plasma - Procedurally generated fractal pattern
| Preview | Generation |
![]() | |














