if you use a viewport as a parent of a tilemap you can use this code to save your tile as png
yield(VisualServer,"frame_post_draw")
var img2=get_viewport().get_texture().get_data()
img2.flip_y()
img2.convert(Image.FORMAT_ETC2_RGBA8)
img2.save_png("vp2.png")