Simple coordinate question
Posted: Sun Jul 24, 2011 9:00 pm
I wish to retrieve the x/y-coordinates of a specific color (where ever it is found; first occurrence would be fine). Now, I could write a bunch of 'for' loops to parse the image until the color is found, but that will use a great deal of cpu and time. Is there any easy way of getting color coordinates. For instance, I could call something like:
OR EVEN
I would appreciate any help.
- Marco
Code: Select all
function findcolor($imagehandle,$red,$green,$blue,$alpha=false) {
...
...
return array('x'=>$x,'y'=>$y);
}Code: Select all
function findcolor($imagehandle,$colorindex) {
...
...
return array('x'=>$x,'y'=>$y);
}- Marco