Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Simple coordinate question

images php coding issues or problems here.

Moderators: macek, egami, gesf

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
iyia12co
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sun Jul 24, 2011 5:45 pm

Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron