<?php namespace Intellex\Manicure\Plugin;

use Intellex\Manicure\Source\ImageDataSource;
use Intellex\Manicure\Source\SourceInterface;

class Grayscale implements PluginInterface {

	/** @inheritdoc */
	public function apply(SourceInterface $source) {
		$data = $source->getData();
		imagefilter($data, IMG_FILTER_GRAYSCALE);

		return new ImageDataSource($data);
	}

}