There aren't any errors for drawing graphics out of bounds... when that happens, they just don't show up. So it's most likely the error is that the coordinates that you're feeding in to your getColorAtPixel(...) method are indeed greater than OR EQUAL TO the dimension of the PHOTO drawing panel (not the canvas panel).
If your image is bird2.jpg, then the width is 300 and the height is 200. You are ONLY allowed to request Color from the image's pixels, for which the x-coordinates are number 0 to 299, and the y-coordinates are numbered 0 to 199.
Hope that helps!