I did some digging around and couldn’t find a really helpful tutorial on making textures tile easily. There are some really complicated ways to do it that will likely produce better results than what I am about to show you but this is a nice quick fix that is sure to work 90% of the time. This technique assumes that you’ll be using some kind of noisy texture like dirt, tree bark, gravel, wood chips, etc. If you are using solid colors or cartoon shading then you might be better off just hand painting the edges to tile properly.
First, you want to make sure you find a good piece inside of your reference photo that doesn’t have too much variety. It doesn’t matter how perfect you match the edges of the texture if the center of the texture has a huge blemish that will make your tiling obvious. You can also go in and balance the colors and lighting on the texture if you have dark spots in your sample. I’m not going to cover that here (mostly because I’m not very good at it, hehe). If you take a large enough photo, or you are lucky enough to have a high MP camera then can widen your shot a little and just crop a good piece of the texture after you load it into Photoshop. Remember that your final texture will likely only be 2048 or less and the final run-time texture might only be 512 or less in size, so a good camera is going to give you more room to crop. Even at 2048 however you are looking at 4MP so if your camera is better than that you have a little room to step back.
Next, in Photoshop, duplicate the base layer and add a mask to that new layer.
You should be certain to have the alpha mask selected before drawing any shapes or else a new layer will be created instead of drawing the shape into the alpha mask. You can select the alpha mask by selecting the “CHANNELS” tab where you will find the different color channels as well as “Layer 1 Mask”. Deselect all color channels and only have the layer mask selected.
Once you’ve done this, use the “Rounded Rectangle Tool” and draw a white rectangle that nearly reaches the edges. I recommend turning on grid lines and using a spacing of 32 pixels. This will give you a nice a even 32 pixel border of black. Next, you want to apply a Blur filter to the mask. The size of your blur depends on the image size and the size of the border you created, but the idea is to pick a value that will barely leave 1 pixel of black are the outer edge of the texture. At this point, you can also add a small amount of uniform noise to the mask if you like, it can make some textures look better.
The last step is easy, use Filter->Other->Offet and enter the offset values. These values should be 1/2 the size of your texture so that the edges of the original image are now at the center of the image. Be sure to select “Wrap Around” so we don’t lose any pixels. Note that the layer mask should have also moved with the color channels.
Done! You can save out your texture and give it a try.