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
Echo is used to Display message on screen. Which is used with echo to not output the trailing newline?
Tell me what is needed to be able to use image function?
How to check curl is enabled or not in PHP
What is magic quotes?
Does php have a future?
Tell us how can we access the data sent through the url with the post method?
Can we extend final class in php?
Does php 7 support mysql?
Explain the difference between isset() and empty()?
Explain what is the use of "echo" in php?
What is string in php?
How to convert strings in hex format?
How to replace a substring in a given string?
Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?
Explain scalar type declarations in php7?