Create your own tile set rule set to use in the formatter.
Use numbers from -1 to 255 to represent the main tiles
Use _tag suffix to represent any variations
e.g. If you have multiple grass tiles, you can encode them like 255, 255_a, 255_b
The number part will share the same bit mask, the suffix will differentiate the textures
Use empty space for empty tiles