2 回答
TA贡献1828条经验 获得超3个赞
/**
* Created by PhpStorm.
* User: shellus
* Date: 2016-12-01
* Time: 23:12
*/
require 'vendor/autoload.php';
// import the Intervention Image Manager Class
use Intervention\Image\ImageManager;
// create an image manager instance with favored driver
$manager = new ImageManager(array('driver' => 'gd'));
$img = $manager->make('1.jpg');
for ($y = 0; $y < $img->height(); $y++)
{
for ($x = 0; $x < $img->width(); $x++)
{
$c = $img -> pickColor($x, $y, 'array');
if(abs($c[0] - 205) < 50 && abs($c[1] - 223) < 50 && abs($c[2] - 211) < 50 ){
$c[0] = $c[1] = $c[2] = 255;
$img -> pixel($c, $x, $y);
}
}
}
$img -> save();
- 2 回答
- 0 关注
- 92 浏览
添加回答
举报