you can use the imageJ plugin "point_cloud.jar" which can be downloaed from the link below. Even though it is for CT-scans, it will work with only one-stack image
It seems to be binary images, if it is so, apply connected component algorithm. But first of all, please clarify that what you want to do with these images? Whether you want to extract a portion or doing some processing in internal part of white pixels?
It seems that you don't have metadata for these images (e.g., a header with additional information), so you have to figure out yourself what would be a reasonable resolution. For this, you may first think at the resolution of scanned images (300 dpi, 600 dpi...), and then degrade it, such as the white line on the black canvas is preserved.
Example
Let's suppose that you conclude that you have pixels of 0.5 mm x 0.5 mm, and the canvas (page) is A4 format (210 mm x 297 mm). You define yourself a coordinate system, e.g. "my origin = (0 mm,0 mm) is the Bottom-Left corner of the Bottom-Left pixel", and then you calculate the coordinates (in mm) of all pixels in the current image; each pixel is referred to its bottom left corner {that is, the pixel (x,y) covers an area defined by BL mm=[x+0.5), y ; UR mm=[x+0.5); [y+0.5) }.
Two remarks: (1) once you have informed your images with these relative coordinates (to the Bottom-Left origin) , you can easily both relate your origin, and change the pixel size, to whatever is necessary in your study (other origins and other length units, respectively; in particular, you may link to an animal size, if you need this); (2) you have the coordinates in length units (as described), but you can transform them in pixels [e.g., the pixel "(3,6)" related to the origin pixel "(0,0)" and you address a matrix, keeping in mind the pixel size if you need to eventually link to the real world].
This is just an example that suggests you a way to approach your problem. It's up to you to finally choose the origin (including a pixel corner out of four, or the pixel center) and units of the coordinate system, as well as the pixel's size, by taking into consideration all information and goals you have. The programming is really easy.
Finally, it's important to be aware that you always have the information on pixel coordinates in the digital images themselves, either expressed or implied, the latter being your current case.
Like Ruxandra said, you don't have that information. It is not present in a bmp, tiff or jpg.
You can use pixel-indices as coordinates, but you could also scale it if you want. If so, rotate the image so that the cow stands on four legs, and measure the distance from head to tail in number of pixels. If you know how big the cow is, you can derive a pixel-size. Choose an arbitrary origin and arbitrary direction of +X and +Y, and you are done!
By convention pixel-indices start at the upper-left corner, and start with zero. For the first 1 in your example, the pixel-index would be 4 + 2 * DimX , or -expressed as (x,y)-, (4, 2) . All in arbitrary units, because the picture is not calibrated.
I think what Sumi has suggested should work for you. Basically identify the size of the image using 'size' command and then scan the matrix one pixel at a time by incrementing row and/or column index. Wherever you find pixel value = 1, the respective index is what you want.
If you are using ImageJ, and your image is binary, just go to Analyze -> Tools -> Save XY Coordinates. it will output a txt file with the horizontal and vertical coordinates of each pixel with value 0