Desaturate.php in ImageMagick 8.3
Same filename and directory in other branches
File
src/Plugin/ImageToolkit/Operation/imagemagick/Desaturate.phpView source
<?php
namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick;
/**
* Defines imagemagick Desaturate operation.
*
* @ImageToolkitOperation(
* id = "imagemagick_desaturate",
* toolkit = "imagemagick",
* operation = "desaturate",
* label = @Translation("Desaturate"),
* description = @Translation("Converts an image to grayscale.")
* )
*/
class Desaturate extends ImagemagickImageToolkitOperationBase {
/**
* {@inheritdoc}
*/
protected function arguments() {
// This operation does not use any parameters.
return [];
}
/**
* {@inheritdoc}
*/
protected function execute(array $arguments) {
$this
->addArgument('-colorspace GRAY');
return TRUE;
}
}
Classes
Name | Description |
---|---|
Desaturate | Defines imagemagick Desaturate operation. |