How do I make a seamless hex tile?

In this post I give two methods for making hexagonal tiles that will tile seamlessly. The methods use any method that can be used to make rectangular tiles that will tile seamlessly, such as the standard filters that come with Photoshop or Gimp.

I adapted the methods below from Turning Square Tiles into Hex. With the original methods, the textures are stretched or rotated in the final result. Here, I added steps to correct this. The original methods was also given for hex tiles that fit in a square; the methods below are for regular hex tiles.

I give two examples for each method. The first image is an actual candidate for a tileable texture; the second one gives more insight in how the method works.

Tips

  • When you use one of these methods for the first time, use an image like the second one (and use the size 1024×1024) to go through all the steps. It’s tricky to get all the steps right, and using a more structured image will help you find problems faster. You will also be able to compare the dimensions of the image with those given below for each step. Once you have the method down, you can try it on proper textures.
  • The quality of the end results depends on properties of the base texture you use, and the quality of the algorithm you use for the step where you make the images seamlessly rect-tileable. You should preprocess the texture in the same way as you would making a seamless rect tile. Gimp’s algorithm (used below) is not very good. It uses a overlap-and blend method, which only works well on certain types of textures. The best (as far as I know) way to make a seamless tile is to overlap a tile with itself, and quilt the images together where they overlap, although I am not sure which plug-ins you could use to do this (if you know, please share in the comments!)

Method 1

Take an image you want to use as base. It need not be tileable, but must be at least as big as the final tile you want to make. I show each step with two images.

Let’s assume you want to make a flat hex tile with height S, and that your texture is S × S. In the examples below, I show how to make a hex tile that is 1024 pixels high, so S = 1024.


p_image003

1024 × 1024


color_base0

1024 × 1024

Step 1

Scale the image to size S × √3S, in other words, scale the width by 173%. The image will now be vertically stretched. Step 3 will fix this distortion.


p_image004

1024 × 1774


color_1

1024 × 1774

Step 2

Crop a S x S square anywhere from the image.

Step 7


p_image005

1024 × 1024


color_2

1024 × 1024

Step 3

Scale the image to (√3/2)S × (1/2)S, in other words, scale the width by 86.6%, and the height by 50%. You can see in the second image the distortion is now fixed; the squares in the image are square again.


p_image006

887 × 512


color_3

887 × 512

Step 4

Make the rectangle seamless.

For instance, in Gimp, you can run the Make Seamless filter (From Filters | Map | Make Seamless). Or you use the Make Seamless Advanced plugin.

If whatever algorithm / filter you use preserves the tile size, good. If the algorithm or filter reduces the size by the overlapping amount, make sure the overlapping amount for x and y is in the ratio √3/2 : 1/2. (or 1.73 : 1). For example, if the overlapping y is 100 pixels, then the overlapping x should be 173 pixels. This means your image will have the same aspect ratio after the algorithm executed. You can then scale it back to √3/2S × 1/2S without any distortion.


p_image008

887 × 512


color_4

887 × 512

Step 5

Tile the image 2 × 2: repeat the image four times in a 2 × 2 grid.

In Gimp, you can use Filters | Map | Tile. Set the units to %, and set both x and y to 200%.

Your image should now be √3S × S, in other words, the width will be 173% the original width, and the height will be the original height.


p_image009

1774 × 1024


color_5

1774 × 1024

Step 6

Now crop a regular hex with height S from it.


grass_6

1182 × 1024


color_6

1182 × 1024

The resulting image can now be tiled seamlessly:

grass_7

color_7

Method 2

Step 1

Scale the image to S × √3S, in other words, scale the height by 173%.

grass_m2_1

1024 × 1774

color_m2_1

1024 × 1774

Step 2

Rotate the image –45 degrees. (Note the sign, it’s negative!)

grass_m2_2
1980 × 1980


color_m2_2

1980 × 1980


Step 3

Crop a square from the image, and scale it to S × S. So it’s the same size as the image you started with.


grass_m2_3

1024 × 1024


color_m2_3

1024 × 1024

Step 4

Make the image rect-seamless.


grass_m2_4

1024 × 1024


color_m2_4

1024 × 1024

Step 5

Tile the image 2 × 2.


grass_m2_5

2048 × 2048


color_m2_5

2048 × 2048

Step 6

Rotate it +45 degrees. Note the sign; it’s positive this time! Extend the canvas if necessary so that the entire diamond is in the image. The image size should be 2√2S × 2√2S., or 283% of the original size.


grass_m2_6

(Shown at half the size as other images)

2898 × 2898


color_m2_6 

(Shown at half the size as other images)

2898 × 2898

Step 7

Scale the image to 2√3S × 2S. In other words, scale the width by 122%, and the height by 71%, to make it 346% of the original width and 200% the original height. Notice, from the second image, that all distortions are now fixed.


grass_m2_7

(Shown at half the size as other images)

3548 × 2048

color_m2_7 

(Shown at half the size as other images)

3548 × 2048

Step 8

Crop a hex with height S anywhere from the image.

grass_m2_8
color_m2_8

The resulting image can now be tiled seamlessly:

grass_m2_9
color_m2_9

6 thoughts on “How do I make a seamless hex tile?”

  1. Pingback: Tiles | Pearltrees

  2. Pingback: How do I make a seamless hex tile that can be rotated? | Gamelogic

  3. Pingback: A cheat for seamless hex tiles | Gamelogic

    1. I means the tile (as a rectangular tile) is seamless when you put it in a rectangular grid. This is usually the type of shamelessness provided by Gimp or Photoshop (through filters / plugins).

Comments are closed.

Scroll to Top