I've been dabbling with IM and really impressed with the results.
Using it via a PHP exec command (shared hosting).
However, I am doing the following, getting an image to convert to 4 colors and display the data, works OK:
Code: Select all
$Tnl="filename.png";
$ClrTxt="filename.txt";
exec("/usr/bin/convert convert $TnL -scale 2x2\! $ClrTxt");
But I am (desperately) trying to get it just to output the Hex values as such:# ImageMagick pixel enumeration: 2,2,255,RGB
0,0: (216,216,222) #D8D8DE
1,0: (239,226,208) #EFE2D0
0,1: (230,223,225) #E6DFE1
1,1: (239,225,206) #EFE1CE
with or without the comma, either in a txt file that can easily be parsed or as a variable that PHP can pick up and use.#D8D8DE,#EFE2D0,#E6DFE1,#EFE1CE
Been looking through MOST of the online docs, but just can't get it to work. Tried lots of things, but even the -format command doesn't seem to be usefull in this case.
Any clues on how to do this?

Thanks for any help.

Gofly