How can I find the colour of a pixel of an image?
Answer Posted / jude jeevanraj.p
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
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Tell me when a conditional statement is ended with an endif?
How do you remove whitespace from the beginning and end of a $string variable?
Why php was called as personal home page?
What is the difference between Session and Cookie?
Write a program to display reverse of any number?
Tell me what are the functions to be used to get the image's properties (size, width and height)?
What is session_start () in php?
What is difference between variable declaration and variable definition?
How can you encrypt password using php?
How do you check if an arraylist is empty?
How to Retrieve the Session ID of the Current Session?
How would you declare a function that receives one parameter name hello?
How do sessions work in php?
What are the Advantages and Application Areas of PHP?
How arrays are passed through arguments?