Seamlessly tilable textures - part 1

Here is a nice concrete slab. Click on the image and save the larger version. The image meassures 2048x1536 so we have a nice high resolution image to work with. Open it in Photoshop. Hit CTRL + 0 (zero!) so we can see what we are doing.
Crop the canvas size Go to menu Image and then to Canvas Size.
Change size Change 2048 to 1536, so it reads 1536 * 1536. Click on the center right field as shown, hit okay, and click "proceed" at the warning.

So now we have a nice and square image we can work with. Let's see how it tiles...

Offset filter Filter-Other-Offset.
Tiling Type in 768 and 768 since that is half the size of our image. Tick wrap around and preview. Nope. It doesn't tile at all. As you can see, there are quite visible seams.


At this point there are two different methods we can use.

Method 1: The Clone Stamp Tool

Add a new layer Add a new layer
The Clone Stamp tool Hit "S" or select the Clone Stamp tool. Make sure "Use All Layers" is ticked, which will allow you to have your adjustments on a separate layer (thus not tampering too much with the source image). I lower the opacity of the tool to around 70-75% and change the brush size to a 100 with soft edges. Hold ALT down as you pick an area you want to clone over the edges. Paint over the edges and continue like that untill you have no strong and visible edges on your concrete images.
Changes To illustrate the changes, view Layer 1 only.
Finished, sort of... Now run the Offset filter (just with the settings it will open with) on both the Background layer and Layer 1 to see the results. This is what I got. And it tiles seamlessly. You can flatten the image if you wish to do so (Layer - Flatten Image).
Method 1 This is what I got when tiling it 3x3. No visible seams.

We could get almost the same results in a slightly different way.

Method 2: Copy, Paste and Delete

Add a new layer Start from where we had made the image square, and add 2 new layers.
Rectangular marquee Select the Background layer. Select the Rectangular Marquee tool (hotkey M). Draw out a rectangular selection like this one at the far left side of your image. Make sure you the selection covers both the top-most and bottom-most pixels, as well as the last fifty or so pixel columns from the left.
Copy selection Go to the menu Edit-Copy or hit CTRL + C to copy your selection.
Free Transform Select Layer 1. Edit-Paste or CTRL + V your selection into Layer 1. CTRL + Left click on Layer 1 to select it. Right click on the selected area and choose Free Transform or hit CTRL + T.
Flip Horizontal Right click again and select Flip Horizontal. Hit RETURN to finalize the changes. Hit CTRL + D to deselect the selection.
Move tool Hit V to select the Move tool or click on it on the tool bar.
Snap to Document Bounds Make sure you have Document Bounds switched on under Snap To in the View menu. Then switch on Snap just above it. Then move the pixels on Layer 1 to the right edge, making sure the three edges of the little strip of concrete aligns up perfectly with the edges of the document over on the right hand side. Now the pixels in the first column from the left and the first from the right are exactly the same.
Eraser tool We just need to smooth out the transition between the Background layer and Layer 1. This is done by selecting the Eraser tool (Hot key "E"). Since it is a fairly large image we are working on, I go for a nice big brush of 100 pixels in diameter with a soft edge. Lower the opacity to around 30%.

Then you start erasing on the visible border between Layer 1 and the Background layer, making sure you don't erase the last few vertical columns of pixels. Since the eraser only takes off 30% you need to go over it 3-4 times before you have completely erased the unneccessary pixels. However just use the eraser till the seam is gone.

Now we need to repeat this operation on either the top and bottom side of the image. Obviously with the slight difference that the selection will not be flipped horizontally but vertically instead. I am sure you get the picture.

Method 2
Method 2: Copy, Paste and Delete
When done, the texture looks something like this when tiled 3x3. No visible seams. We can flatten the image now (Layer - Flatten Image), if you want to do so.
Method 1
Method 1: The Clone tool
Side by side our images from method 1 and 2 look fairly similar. Which method you prefer is up to your personal preferences, but here you see them compared when tiled.

Summary

Let's take a moment to reflect on what it was we did here, besides pushing buttons and changing parametres. In order for a texture or an image to be able to tile seamlessly we need to make sure that pixels on its four outer edges are all more or less similar, or at least don't stand out when put next to each one another. Or else a seam will be generated.

We did that first, by cutting up the image in four equal chunks, and then rearranging them, so the outer edges were forced next to the corresponding edges they would sit next to when tiled. This of course immediately exposed the seams which would be generated. Those seams we painted over with slightly transparent samples of the original image, untill they were completely blended away. Which in turn means that if they can't be distinguished from the rest of the image now, neither will they generate seams when we rearrange our image back to how it was, and tile it a number of times.

Secondly, we just simply copied the pixels on the outer edges, and pasted them on top of the edges they would correspond with when tiled. That way you are certain your edges will match each other. Of course, you can't just have the very last column or row of pixels copied over, but you need to blend the two parts of the image together. A smooth transition can be attained by using an erasing with low opacity to gradually rub out one layer to gradually expose the one below.

But there is still much we can do to improve the look of this texture, when it is tiled a number of times. Skip ahead to

Seamlessly Tilable Textures - Part 2








Back where you came from Now is a good time!