PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How can I find the colour of a pixel of an image?


This is easily done through using the imagecolorat function.

You must pass as parameters the image resource, and the x and y co-ordinates you want to find the color of, for instance:

$rgb = imagecolorat($im, 5, 10);

Will get a reference to the colour used at 5,10 (X,Y) on the image.

Depending on the version of the GD library you are using and the type of image, you may experience different return values, for more information take a look at:

http://uk3.php.net/manual/en/function.imagecolorat.php


Comment on this Question and Answer >>>

ASK A QUESTION

More images PHP Questions

I recently updated from shared servers to virtual dedicated, I now cannot see any of the images I try to upload. The hosting company says that the script for the images are in the root directory but the images are not. The programmer said he didn't c

How can I add text to an image?

how can i load images with php?

how to rotate an image using php code?

How can I find the width and height of an image resource?



Custom Search