The first white pixel is relative to 0, all subsequent white pixels are relative to the one preceding it. Consider the (completely random) following white pixels in an image of 100x5: (0,47) ; (0,96) ; (1,32) ; (1,74) ; (2,06) ; (2,52) This yields locations as follows (totalWidth*row+column): 047 = ((100 * 0) + 47) 096 = ((100 * 0) + 96) 132 = ((100 * 1) + 32) 174 = ((100 * 1) + 74) 206 = ((100 * 2) + 06) 252 = ((100 * 2) + 52) This would them give you the following ASCII codes: 47 49 36 42 32 46 Convert those to get the morse code symbols, and decode the morse.