mirror of
https://github.com/Intervention/image.git
synced 2025-08-10 16:04:04 +02:00
added greyscale method
This commit is contained in:
@@ -197,6 +197,16 @@ class Image
|
|||||||
imagefilter($this->resource, IMG_FILTER_PIXELATE, $size, $advanced);
|
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()
|
public function reset()
|
||||||
{
|
{
|
||||||
$this->setProperties($this->dirname .'/'. $this->basename);
|
$this->setProperties($this->dirname .'/'. $this->basename);
|
||||||
|
@@ -105,7 +105,13 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
|||||||
{
|
{
|
||||||
$img = $this->getTestImage();
|
$img = $this->getTestImage();
|
||||||
$img->pixelate(20);
|
$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);
|
$this->assertInstanceOf('Intervention\Image\Image', $img);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user