In javascript there is function getImageData(), is there any function in PHP similar to that.
Have a look at the GD library functions:
http://www.php.net/manual/en/ref.image.php
EDIT:
Specifically, the getimagesize function for dimensions and more :)
EDIT
Hello again. This should help. You can get the RGB values of your image like so:
// the file
$file = 'test.gif';
// get the width and height of the image
list($width, $height) = getimagesize($file);
// create your image resource
$image = imagecreatefromgif($file);
// you could use the image width and height values here to
// iterate through each pixel using two nested for loops...
// or... set specific values for $x and $y
$x = 0;
$y = 0;
// get the colour index for the current pixel
$colourIndex = imagecolorat($image, $x, $y);
// get an array of human-readable RGB values
$colourValues = imagecolorsforindex($image, $colourIndex
// display RGB values
print_r($colourValues);
GD is your best bet:
http://php.net/manual/en/function.imagecreatefromjpeg.php
You'll need to know the type (png, jpg) before you start.