diff --git a/src/Intervention/Image/Image.php b/src/Intervention/Image/Image.php index 738c1bee..cac4af0f 100644 --- a/src/Intervention/Image/Image.php +++ b/src/Intervention/Image/Image.php @@ -197,6 +197,16 @@ class Image imagefilter($this->resource, IMG_FILTER_PIXELATE, $size, $advanced); } + public function grayscale() + { + imagefilter($this->resource, IMG_FILTER_GRAYSCALE); + } + + public function greyscale() + { + $this->grayscale(); + } + public function reset() { $this->setProperties($this->dirname .'/'. $this->basename); diff --git a/tests/ImageTest.php b/tests/ImageTest.php index 6b5c89e8..9790f89d 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -105,7 +105,13 @@ class ImageTest extends PHPUnit_Framework_Testcase { $img = $this->getTestImage(); $img->pixelate(20); - $img->save('public/pixels.jpg'); + $this->assertInstanceOf('Intervention\Image\Image', $img); + } + + public function testGreyscaleImage() + { + $img = $this->getTestImage(); + $img->greyscale(); $this->assertInstanceOf('Intervention\Image\Image', $img); }