I also don't like that this function is using two different coordinate systems. The image coordinate system, where each pixel is a square of 1 unit across, and the global coordinate system, where the *image* is a square of 1 unit across. I'll try to fix that.