<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja"
xml:lang="ja" dir="ltr">
<head>
<title>sample1133(ImageMagick6.5.2)</title>
</head>
<body>
<?php
$im = new Imagick("sf.jpg");
//$im->setImageColorspace(Imagick::COLORSPACE_GRAY);
$im->medianFilterImage(1.5);
$im->quantizeImage(8, Imagick::COLORSPACE_GRAY, 0, FALSE , false);
$im2 = new Imagick();
$im2->newPseudoImage(1, 2, 'gradient:#803010ff-#ffffffff');
/* 任意の2色に変換 */
$im->addImage($im2);
$im->setImageIndex(0);
$im3 = $im->fxImage("v.p{0,(r+g+b)/3}");
$im3->writeImage('sample1133a.png');
$im3->destroy();
$im2->destroy();
$im->destroy();
?>
<img src="sample1133a.png" /><br />
</body>
</html>
元画像(sf.jpg)
出力画像(sample1133a.png)
No comments:
Post a Comment