mirror of
https://github.com/Intervention/image.git
synced 2025-01-17 12:18:14 +01:00
added greyscale method
This commit is contained in:
parent
514ba420bc
commit
a6143438ab
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user