How can I find the colour of a pixel of an image?
Answer Posted / laxmikant
<?php
$im = imagecreatefrompng("php.png");
$rgb = imagecolorat($im, 10, 15);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
var_dump($r, $g, $b);
?>
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is putenv?
Is php fully object oriented?
What is artisan in php?
Describe PHP error and logging information?
What is the use of htmlspecialchars in php?
Explain about the $_GET variable of PHP?
How to include variables in double-quoted strings?
Explain about switch statement in PHP?
Does browser understand php?
Which php mvc framework is best?
Explain Type juggling?
How is a constant defined in a PHP script?
What is php data type?
What's the difference between __sleep and __wakeup?
What is the use of token in php?