visto che un'immagine viene "mappata" (almeno per quanto riguarda getRGB) in una matrice 0..width-1 x 0..height-1 i tuoi "bordi saranno"

NORD: [0,0]..[width-1,0]
EST: [width-1,0]..[width-1,height-1]
SUD: [0, height-1]..[width-1,height-1]
OVEST: [0,0]..[0,height-1]

Pui anche convenientemente utilizzare l'altro getRGB che ritorna un array

http://java.sun.com/javase/6/docs/ap...1;], int, int)