Back when I was trying to make a game I wanted to copy a map from an old game, so I made a script that took a photo of a game map (like an old tiled NES game) and converted it to a matrix with an index of unique tile types, basically reversing the process of how tiled maps work.