How do I import a tileset with extruded borders?

I used Texture Packer to extrude the borders of each tile by 2 pixels, but trying to import it as a tileset is a bit confusing. I’ve tried importing the image using 2 pixel margin, 2 pixel spacing, and. 2 of both, but none of these options look correct in Tiled.

Which settings do I need to make a 2 pixel wide extrusion appear correctly in a tileset?

Here’s the sprite sheet I’m using for the tileset:

The correct settings were 2 margin and 4 spacing.

The logic here seems to be:

  • Margin is the size of your extruded border in pixels, in my case 2.
  • Spacing is the space between your tiles, excluding the border pixels. Because there are 2 border pixels on both sides of each of my tiles, there is a spacing of 4 pixels between tiles.