Applies filter to given image

@param  Image $image
@return Image
354362
public function applyFilter(Image $image)
    {
        if ($image->width() >= $image->height())
        {
            return $image->resize(272, null, function ($constraint)
            {
                $constraint->aspectRatio();
            });
        }

        return $image->resize(null, 272, function ($constraint)
        {
            $constraint->aspectRatio();
        });
    }
396527
public function applyToImage(Image $image, $x = 0, $y = 0)
    {
        $background = new Color($this->background);
        imagefilledrectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt());

        if ($this->hasBorder()) {
            $border_color = new Color($this->border_color);
            imagesetthickness($image->getCore(), $this->border_width);
            imagerectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt());
        }

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

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

        return $this;
    }
227668
public static function image($image, $options = [])
	{
		$static = new static;

		$static->image = $image;
		$static->options = $options;
		$static->intervention = new ImageManager(['driver' => 'gd']);

		$static->normalizeNames();

		return $static;
	}
983781
public function execute($image)
    {
        $amount = $this->argument(0)->between(0, 100)->value(10);

        // build matrix
        $min = $amount >= 10 ? $amount * -0.01 : 0;
        $max = $amount * -0.025;
        $abs = ((4 * $min + 4 * $max) * -1) + 1;
        $div = 1;

        $matrix = [
            [$min, $max, $min],
            [$max, $abs, $max],
            [$min, $max, $min]
        ];

        // apply the matrix
        return imageconvolution($image->getCore(), $matrix, $div, 0);
    }
298249
public function execute($image)
    {
        $size = $this->argument(0)->type('digit')->value(10);

        return imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $size, true);
    }
162239
public function execute($image)
    {
        $level = $this->argument(0)->between(-100, 100)->required()->value();

        return $image->getCore()->sigmoidalContrastImage($level > 0, $level / 4, 0);
    }
296055
public function apply(ImageInterface $image)
    {
        if (!$image instanceof Image) {
            throw new InvalidArgumentException("This filter is supported by Image Magick driver only!");
        }
        return $image->applyMask($this->shapeMask)->removeTransparency(new Color('fff'));
    }
1021674
public function getImage(Image $image)
    {
        if (is_null($this->watermarks)) {
            return;
        }

        if (!is_string($this->mark)) {
            return;
        }

        if ($this->mark === '') {
            return;
        }

        $path = $this->mark;

        if ($this->watermarksPathPrefix) {
            $path = $this->watermarksPathPrefix.'/'.$path;
        }

        if ($this->watermarks->has($path)) {
            $source = $this->watermarks->read($path);

            if ($source === false) {
                throw new FilesystemException(
                    'Could not read the image `'.$path.'`.'
                );
            }

            return $image->getDriver()->init($source);
        }
    }
556542
public function addImage(Image $image)
    {
        $images = array_map('strval', $this->images->toArray());
        if (!in_array($image->getSource(), $images)) {
            $this->images->add($image);
            $image->setItem($this);
        }

        return $this;
    }
1234692
public function addImage(\Elcodi\Component\Media\Entity\Interfaces\ImageInterface $image)
    {
        $this->images->add($image);

        return $this;
    }
741290
public function imageInspect($image)
    {
        return $this->browser->get(
            $this->uri->expand(
                '/images/{image}/json',
                array(
                    'image' => $image
                )
            )
        )->then(array($this->parser, 'expectJson'));
    }
72321
public function applyFilter(Image $image)
    {
        return $image->resize(300, null, function($constraint) {
            $constraint->aspectRatio();
        })->encode('jpg', 40);
    }
1055604
public function performImageResize(File $image)
    {
        if ($image instanceof Image) {
            
            return $this->tools()->resize(
                $image,
                $this->owner->ImageResizeWidth,
                $this->owner->ImageResizeHeight,
                $this->owner->ImageResizeMethod
            );
            
        }
        
        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)');
        }
    }
958585
public function execute($image)
    {
        $color = $this->argument(0)->required()->value();
        $color = new Color($color);
        $x = $this->argument(1)->type('digit')->required()->value();
        $y = $this->argument(2)->type('digit')->required()->value();

        return imagesetpixel($image->getCore(), $x, $y, $color->getInt());
    }
859264
public function applyToImage(Image $image, $x = 0, $y = 0)
    {
        $color = new Color($this->color);
        imageline($image->getCore(), $x, $y, $this->x, $this->y, $color->getInt());

        return true;
    }