public function doFilter($file, $arguments, $typeOptions)
    {
        if (! $arguments['grayscale']) {
            return;
        }

        $Imagine = new Imagine();
        $image = $Imagine->open($file);
        $image->effects()->grayscale();
        $image->save($file);
    }