ImageMagick image processing for marko/media --- resize, crop, and convert images with superior quality, AVIF support, and ICC color profile handling. Provides an ImageProcessorInterface implementation backed by the Imagick PHP extension, delivering higher-quality resampling (Lanczos filter), broader format support including AVIF and WebP, and ICC color profile preservation --- advantages over the GD-based driver for production image pipelines. Requires ext-imagick installed separately via PECL.
Every processing method (resize, crop, convert, thumbnail) checks the input image’s format against this list before doing any work. Non-allowlisted formats and format mismatches throw ImagickProcessingException. Add formats to the list to permit additional input types supported by your ImageMagick build.
AVIF is the key differentiator over the GD driver --- it produces smaller files with better quality than WebP or JPEG, and is fully supported by Imagick:
use Marko\Media\Contracts\ImageProcessorInterface;
Choose marko/media-gd when ext-gd is sufficient and memory is constrained. Choose marko/media-imagick when quality, AVIF, or broad format support matters.
All methods return the absolute path to the processed output file in the system temp directory. All methods check the input format against allowed_raster_formats before processing and throw ImagickProcessingException on failure or if the format is not allowed.