Thanks for the replies all.
It seems some kind of plugin is the way to go.
An array won't help me because the heightmap will be created by the artist who creates the background image and then I'm back to the same problem of trying to access a image's RGBA values.