john
john

Reputation: 2683

Imagemagick & php prevent text output while using convert

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?

Upvotes: 0

Views: 209

Answers (1)

strauberry
strauberry

Reputation: 4199

http://php.net/manual/de/function.system.php -> set the return var value, so the output is placed there instead of printed out

Upvotes: 1

Related Questions