every tile set has at least 8*48=384 tile ids. the first 48 from 0-47 are reserved for the in built blank tile the next 336 ids are for the 7 autotiles in each tileset. 48-95 = first autotile, 96-143 = second, 144-191=third, 192-239=forth, 240-287=fifth, 288-355=sixth, 356-383=seventh. starting at id 384 the normal tiles in the tile set image begin. ie the first row is 384-391.
Autotiles are split apart into 32*32 tiles and each tiles is split apart into 16*16 squares. these 16* 16 squares are combined in different combinations to create 48 different tiles. each combination is identified by a different id.
This array is uses to put together these combinations. each position in the array
Autotiles = [
[[27, 28, 33, 34], [5, 28, 33, 34], [27, 6, 33, 34],
[5, 6, 33, 34], [27, 28, 33, 12], [5, 28, 33, 12],
[27, 6, 33, 12], [5, 6, 33, 12] ],
[[27, 28, 11, 34], [5, 28, 11, 34], [27, 6, 11, 34],
[5, 6, 11, 34], [27, 28, 11, 12], [5, 28, 11, 12],
[27, 6, 11, 12], [5, 6, 11, 12] ],
[[25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12],
[25, 6, 31, 12], [15, 16, 21, 22], [15, 16, 21, 12],
[15, 16, 11, 22], [15, 16, 11, 12] ],
[[29, 30, 35, 36], [29, 30, 11, 36], [5, 30, 35, 36],
[5, 30, 11, 36], [39, 40, 45, 46], [5, 40, 45, 46],
[39, 6, 45, 46], [5, 6, 45, 46] ],
[[25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20],
[13, 14, 19, 12], [17, 18, 23, 24], [17, 18, 11, 24],
[41, 42, 47, 48], [5, 42, 47, 48] ],
[[37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24],
[13, 14, 43, 44], [37, 42, 43, 48], [17, 18, 47, 48],
[13, 18, 43, 48], [1, 2, 7, 8] ]
]
if the id of the tile is less than 384 then we know that the tile is some combination of an autotile.
gives us the index of the autotile 0 being the first of the left and 6 being the last on the right
from there we can get a list of the 16*16 squares that we need to combine be pulling them from the array above like so
and now bitmap is a 32*32 tile from the tileset.
I've collected the data here. I'm not sure how we are going to do this yet though.