You only need 15 tiles to paint any map shape
The trick is a dual grid. The classic setup checks all 8 neighbors of a cell, and that takes 47 tiles
> Paint your map as plain cells
> Place the tiles on a second grid, shifted half a tile
> Each tile reads the 4 cells under its corners
> Turn those 4 yes/no answers into a number, 0 to 15
> Look up the tile for that number (0 = no land)
If you didn't understand any of that, just ask your agent to implement it. Happy painting!