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