Imagemagick & php在使用convert时阻止文本输出
您好:我正在使用这些命令来比较颜色,它可以工作,但是它会打印我不想打印的文本:
$color2= system("/usr/bin/convert xc:'#".$color2."' -format '%[pixel:s]' info:");
$result= system("/usr/bin/convert xc:'".$color."' -alpha set -channel RGBA -fuzz ".$fuzz." -fill '".$color2."' -opaque '".$color2."' -format '%[pixel:s]' info:");
输出:
red grey20 rgb(238,0,0) grey20 rgb(221,0,0) grey20 rgb(204,0,0) grey20 rgb(187,0,0) grey20 rgb(170,0,0) grey20 rgb(153,0,0) grey20 rgb(136,0,0) grey20 rgb(119,0,0) grey20 rgb(102,0,0) grey20 rgb(85,0,0) grey20 rgb(68,0,0) grey20 rgb(51,0,0) grey20 rgb(204,51,51) grey20 rgb(153,51,51) grey20 rgb(204,102,102) grey20 rgb(204,0,51) grey20 lime grey20 rgb(0,238,0) grey20 rgb(0,221,0) grey20 rgb(0,204,0) grey20 rgb(0,187,0) grey20 rgb(0,170,0) grey20 rgb(0,153,0) grey20 rgb(0,136,0) grey20 rgb(0,119,0) grey20 rgb(0,102,0) grey20 rgb(0,85,0) grey20 rgb(0,68,0) grey20 rgb(0,51,0) grey20 blue grey20 rgb(0,0,238) grey20 rgb(0,0,221) grey20 rgb(0,0,204) grey20 rgb(0,0,187) grey20 rgb(0,0,170) grey20 rgb(0,0,153) grey20 rgb(0,0,136) grey20 rgb(0,0,119) grey20 rgb(0,0,102) grey20 rgb(0,0,85) grey20 rgb(0,0,68) grey20 rgb(0,0,51) grey20 rgb(0,127,255) grey20 rgb(51,51,102) grey20 cyan grey20 rgb(153,204,255) grey20 rgb(127,0,255) grey20 rgb(102,45,145) grey20 rgb(255,0,127) grey20 rgb(244,154,193) grey20 yellow grey20 rgb(255,127,0) grey20 rgb(247,148,29) grey20 rgb(96,58,32) grey20 rgb(117,76,36) grey20 black grey20 grey20 grey20
如何防止该文本被显示?
Hi: I am using these commands to compare colors, it works however it prints text that I do not want to be printed:
$color2= system("/usr/bin/convert xc:'#".$color2."' -format '%[pixel:s]' info:");
$result= system("/usr/bin/convert xc:'".$color."' -alpha set -channel RGBA -fuzz ".$fuzz." -fill '".$color2."' -opaque '".$color2."' -format '%[pixel:s]' info:");
outputs:
red grey20 rgb(238,0,0) grey20 rgb(221,0,0) grey20 rgb(204,0,0) grey20 rgb(187,0,0) grey20 rgb(170,0,0) grey20 rgb(153,0,0) grey20 rgb(136,0,0) grey20 rgb(119,0,0) grey20 rgb(102,0,0) grey20 rgb(85,0,0) grey20 rgb(68,0,0) grey20 rgb(51,0,0) grey20 rgb(204,51,51) grey20 rgb(153,51,51) grey20 rgb(204,102,102) grey20 rgb(204,0,51) grey20 lime grey20 rgb(0,238,0) grey20 rgb(0,221,0) grey20 rgb(0,204,0) grey20 rgb(0,187,0) grey20 rgb(0,170,0) grey20 rgb(0,153,0) grey20 rgb(0,136,0) grey20 rgb(0,119,0) grey20 rgb(0,102,0) grey20 rgb(0,85,0) grey20 rgb(0,68,0) grey20 rgb(0,51,0) grey20 blue grey20 rgb(0,0,238) grey20 rgb(0,0,221) grey20 rgb(0,0,204) grey20 rgb(0,0,187) grey20 rgb(0,0,170) grey20 rgb(0,0,153) grey20 rgb(0,0,136) grey20 rgb(0,0,119) grey20 rgb(0,0,102) grey20 rgb(0,0,85) grey20 rgb(0,0,68) grey20 rgb(0,0,51) grey20 rgb(0,127,255) grey20 rgb(51,51,102) grey20 cyan grey20 rgb(153,204,255) grey20 rgb(127,0,255) grey20 rgb(102,45,145) grey20 rgb(255,0,127) grey20 rgb(244,154,193) grey20 yellow grey20 rgb(255,127,0) grey20 rgb(247,148,29) grey20 rgb(96,58,32) grey20 rgb(117,76,36) grey20 black grey20 grey20 grey20
How do I prevent that text from being dispalyed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://php.net/manual/de/function.system.php ->设置返回 var 值,因此输出放置在那里而不是打印出来
http://php.net/manual/de/function.system.php -> set the return var value, so the output is placed there instead of printed out