@param ImagineImageInterface $image

@return ImagineImageInterface
13806
public function updateFile(ImagineImageInterface $image)
    {
        if ($this->direction !== null) {
            $transformation = new Transformation();

            if ($this->direction == 'x') {
                $transformation->flipHorizontally();
            } elseif ($this->direction == 'y') {
                $transformation->flipVertically();
            }

            $transformation->apply($image);
        }

        return $image;
    }
628356
public function run(Image $image)
    {
        $sharpen = $this->getSharpen();

        if ($sharpen !== null) {
            $image->sharpen($sharpen);
        }

        return $image;
    }
1360417
protected function resize(ImagineImageInterface $image, $mode = ImageInterface::RATIOMODE_INSET, $filter = ImagineImageInterface::FILTER_UNDEFINED)
    {
        if ($mode !== ImageInterface::RATIOMODE_INSET &&
            $mode !== ImageInterface::RATIOMODE_OUTBOUND
        ) {
            throw new \InvalidArgumentException('Invalid mode specified');
        }

        $imageSize = $image->getSize();
        $requestedDimensions = $this->calculateDimensions($imageSize);

        $image->strip();

        $resizeDimensions = $requestedDimensions;
        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $resizeDimensions = $this->calculateOutboundScalingDimensions($imageSize, $requestedDimensions);
        }

        $image->resize($resizeDimensions, $filter);

        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $image->crop(new Point(
                max(0, round(($resizeDimensions->getWidth() - $requestedDimensions->getWidth()) / 2)),
                max(0, round(($resizeDimensions->getHeight() - $requestedDimensions->getHeight()) / 2))
            ), $requestedDimensions);
        }

        return $image;
    }
69263
public function setImage(\Core\Entity\Image $image = null) {
        $this->image = $image;

        return $this;
    }
293543
public function apply( $image ) {

        imagefilter($image->getCore(), IMG_FILTER_COLORIZE, $this->red, $this->green, $this->blue);
        return $image;
    }
1148408
private function initImage($image)
    {
        if(is_string($image))
        {
            return new Imagick($image);
        }
        elseif ($image instanceof Imagick)
        {
            return $image;
        }
        else
        {
            throw new Exception('Image input must be Imagick object or string path ('.gettype($image).' sent)');
        }
    }
66694
public function dispatchImagePreUploadEvent(ImageInterface $image)
    {
        $imageUploadedEvent = new ImageUploadedEvent($image);

        $this->eventDispatcher->dispatch(
            ElcodiMediaEvents::IMAGE_PREUPLOAD,
            $imageUploadedEvent
        );

        return $this;
    }
377545
public function setImage(string $image)
    {
        $this->image = $image;

        $this->raw = array_merge($this->raw, ['Image' => $image]);

        return $this;
    }
668166
public function removeImage(\Elcodi\Component\Media\Entity\Interfaces\ImageInterface $image)
    {
        $this->images->removeElement($image);

        return $this;
    }
1172576
public function run(Image $image)
    {
        if (is_null($this->bg)) {
            return $image;
        }

        $color = (new Color($this->bg))->formatted();

        if ($color) {
            $new = $image->getDriver()->newImage($image->width(), $image->height(), $color);
            $new->mime = $image->mime;
            $image = $new->insert($image, 'top-left', 0, 0);
        }

        return $image;
    }
509314
public function apply( $image ) {

        imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $this->amount, true);
        return $image;
    }
472318
public function apply( $image ) {

        $size = $this->amount;
        $width = $image->getWidth();
        $height = $image->getHeight();
        $image->getCore()->scaleImage(max(1, ($width / $size)), max(1, ($height / $size)));
        $image->getCore()->scaleImage($width, $height);
        return $image;
    }
162239
public function execute($image)
    {
        $level = $this->argument(0)->between(-100, 100)->required()->value();

        return $image->getCore()->sigmoidalContrastImage($level > 0, $level / 4, 0);
    }
493359
public function run(Image $image)
    {
        if ($this->filt === 'greyscale') {
            return $this->runGreyscaleFilter($image);
        }

        if ($this->filt === 'sepia') {
            return $this->runSepiaFilter($image);
        }

        return $image;
    }
862734
private function toRGB(ImageInterface $image)
    {
        if ('cmyk' == $image->palette()->name()) {
            $image->usePalette(new RGB());
        }

        return $image;
    }
540626
public function imageWithMetadataAction(ImageInterface $image)
    {
        $this->response->setHeader('Content-Type', 'application/json');
        $imageProperties = $this->getImageInterfacePreviewData($image);

        return json_encode($imageProperties);
    }
851208
public function manipulateImage(ImageInterface $image, ImagePathInterface $path)
    {
        /**
         * @var ImageOptimizerInterface $optimizer
         */
        $optimizer = null;
        if (!empty($this->imageOptimizers[$image->getMimeType()])) {
            // Use the first matching optimizer.
            $optimizer = reset($this->imageOptimizers[$image->getMimeType()]);
        }
        if ($optimizer) {
            $optimizer->optimizeImage($image);
        }
    }