Simple coordinate question

images php coding issues or problems here.

Moderators: macek, egami, gesf

iyia12co
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jul 24, 2011 5:45 pm

Simple coordinate question

Postby iyia12co » Sun Jul 24, 2011 5:53 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:

Code: Select all

function findcolor($imagehandle,$red,$green,$blue,$alpha=false) {
   ...
   ...
   return array('x'=>$x,'y'=>$y);
}


OR EVEN

Code: Select all

function findcolor($imagehandle,$colorindex) {
   ...
   ...
   return array('x'=>$x,'y'=>$y);
}


I would appreciate any help.

- Marco

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 0 guests