You can get the pixels from an image using the method described in this question: How to use JavaScript or jQuery to read a pixel of an image when user clicks it?
var img = new Image();
img.src = 'image.jpg';
var context = document.getElementById('canvas').getContext('2d');
context.drawImage(img, 0, 0);
data = context.getImageData(x, y, 1, 1).data;
Then loop through the array of pixels and check for the threshold value you are looking for. 0 being fully transparent and 255 being fully opaque.
This question might be a help aswell on how to access the specific color channel: getPixel from HTML Canvas?
You will want to look at pix[i+3]
which in the linked example holds the alpha channel.
Your current pixel position is simply calculated by using the current loop iteration and dividing it by your width which gives you the current height.
For example your image is 200x50 px. You hit a not fully transparent pixel at loop iteration 534, 534/200 = 2 so your are 2 pixels down at the Y axis and then get the remainder with 534 mod 200. So you know how far "in" your at the X axis.