how to get the color value of a point (2)?
Posted: 2011-10-27T04:28:38-07:00
refer to older question:
how to get the color value of a point?
then i want to enlarge the png border,but the result png border color is not the same with older one.
the source kk.png:
how to get the color value of a point?
then i want to enlarge the png border,but the result png border color is not the same with older one.
the source kk.png:
Code: Select all
<?php
exec("convert kk.png[1x1] -format " .
"\"%[fx:floor(255*u.r)],%[fx:floor(255*u.g)],%[fx:floor(255*u.b)]\" " .
"info: 2>&1",$result);
include_once("../color_converter/color_converter.class.php");
$rgb=explode(",",$result[0]);
$cc=new colorConverter();
$hex=$cc->RGB2HEX($rgb[0],$rgb[1],$rgb[2]);
$rgb_str=$result[0];
echo "rgb_str = $result[0]<br>";
echo "array = ";print_r($rgb);
echo "<br>hex = $hex<br>";
exec("convert kk.png -crop 198x198+1+1 laji.png 2>&1",$err);
exec("convert laji.png -bordercolor rgb($result[0]) -border 10x10 laji.png");
echo "<img src='kk.png'/>";
echo "<img src='laji.png'/>";
?>