19declare(strict_types=1);
39 public const ID =
'greyscale';
53 return GDEngine::class;
62 $image = $this->
from($stream);
63 if (!is_resource($image) && !$image instanceof \GdImage) {
66 imagefilter($image, IMG_FILTER_GRAYSCALE, 50,
true);
70 $this->
to($image, $for_definition->getQuality()),
dependsOnEngine()
Return the class name of the Engine that is required for this Machine to work.
canHandleDefinition(FlavourDefinition $definition)
Check if a corresponding configuration can be processed by this Machine.
The base interface for all filesystem streams.
persist()
Define whether the generated flavor and the respective streams should be persisted,...
processStream(FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
trait GdImageToStreamTrait