[PHP]get_image_rgb

public function get_image_rgb($image_path,$x=0,$y=0)
{
    if(!is_readable($image_path))
        return false;
    $im = imagecreatefrompng($image_path);
    $rgb = imagecolorat($im, $x, $y);
    $r = ($rgb >> 16) & 0xFF;
    $g = ($rgb >> 8) & 0xFF;
    $b = $rgb & 0xFF;
    return array(
        'r' => $r,
        'g' => $g,
        'b' => $b,
    );
}