I am struggling to work out how image coordinates are calculated and how to be consistent when finding particular points in an image using these coordinates for further analysis. I don't think it is necessarily a bug, but it makes it tricky to work with and modify images.
This is best shown by the following example.
We make a test image:
testIm=ImagePad[Image[IdentityMatrix[15]], {{0, 10}, {0, 0}}]
We then replace one of the pixels (at position 20,3) with the value 2 (so it is easy to find.)
testIm2=ReplacePixelValue[testIm, {20, 3} -> 2]
We now try to find the coordinates of this pixel with the value 2.
coords=Position[ImageData[testIm2], 2 | 2.]
which gives the result {13,20}
? What is going on here ? How can we be sure of choosing the right pixel values ?