public function grayscale()
	{
		if ( $this->test() )
		{
			if ( class_exists('\\Imagick') )
			{
				if ( !$this->img->modulateImage(100,0,100) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
			else if ( function_exists('imagefilter') )
			{
				if ( !imagefilter($this->img,IMG_FILTER_GRAYSCALE) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
		}
		return $this;
	}
public function grayscale()
	{
		if ( $this->test() )
		{
			if ( class_exists('\\Imagick') )
			{
				if ( !$this->img->modulateImage(100,0,100) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
			else if ( function_exists('imagefilter') )
			{
				if ( !imagefilter($this->img,IMG_FILTER_GRAYSCALE) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
		}
		return $this;
	}
public function grayscale ( ) { if ( $ this -> test ( ) ) { if ( class_exists ( '\\Imagick' ) ) { if ( ! $ this -> img -> modulateImage ( 100 , 0 , 100 ) ) { $ this -> error = \ defined ( 'BBN_THERE_HAS_BEEN_A_PROBLEM' ) ? BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem' ; } } else if ( function_exists ( 'imagefilter' ) ) { if ( ! imagefilter ( $ this -> img , IMG_FILTER_GRAYSCALE ) ) { $ this -> error = \ defined ( 'BBN_THERE_HAS_BEEN_A_PROBLEM' ) ? BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem' ; } } } return $ this ; }
Converts the image's color to grayscale.

```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->grayscale()->save();
```

@return image
Converts the image s color to grayscale .