By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,746 Members | 1,780 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,746 IT Pros & Developers. It's quick & easy.

Pixel colour

P: n/a
I'm using PHP4.2.2 with gd on a Linux platform and am having difficulty
in solving a little problem despite going through the definitions of the
various image functions.

If you load a true-colour image from a file using...

$image=imagecreatefrompng("file.png");

....how do you then get the red, green and blue values of a pixel at $x,
$y within that image? I'm sure it's fairly simple but I can't find this
from what I've read so far.

Can anyone give me any pointers?
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Derek Scollon <ds******@scotwebsolutions.com> wrote:
I'm using PHP4.2.2 with gd on a Linux platform and am having difficulty
in solving a little problem despite going through the definitions of the
various image functions.

If you load a true-colour image from a file using...

$image=imagecreatefrompng("file.png");

...how do you then get the red, green and blue values of a pixel at $x,
$y within that image? I'm sure it's fairly simple but I can't find this
from what I've read so far.


imagecolorat():
http://uk.php.net/manual/en/function.imagecolorat.php

HTH;
JOn
Jul 17 '05 #2

P: n/a
Jon Kraft wrote:
Derek Scollon <ds******@scotwebsolutions.com> wrote:

I'm using PHP4.2.2 with gd on a Linux platform and am having difficulty
in solving a little problem despite going through the definitions of the
various image functions.

If you load a true-colour image from a file using...

$image=imagecreatefrompng("file.png");

...how do you then get the red, green and blue values of a pixel at $x,
$y within that image? I'm sure it's fairly simple but I can't find this
from what I've read so far.

imagecolorat():
http://uk.php.net/manual/en/function.imagecolorat.php

HTH;
JOn


Brilliant. I missed this function completely. Thanks very much Jon.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.