How to make your image tile

In this tutorial, I will take a previously created image and turn it into a seamless texture. I will be using Paint Shop Pro 7, and assume you have a basic knowledge of the tools. For in-depth tutorials on Paint Shop Pro's tools go here. You will also need the Half Wrap filter, which you can get here. This filter is so basic and so useful that it really should have been included in PSP.

You'll have to click the images to see the larger versions, in order to see the details.

Starting Out

Click for a larger image Load up the image you want to work on. UnrealEd can only work with images that are sized in powers of 2 (128 x 128, 32 x 64 etc) so if your source image is an odd size you should crop or resize it appropriately. Also remember that most of Paint Shop Pro's effects only work in 24-bit (16.7 million) colour mode. If your source art is in a lower colour depth you'll have to increase it.
This is my base image, 512 x 512 and 16.7 million colours. It's an interesting pattern I got playing around with the random features of Super Blade Pro. You don't have to use this plug-in, it's just fun to play with. Ironically, even though Blade Pro isn't meant to produce seamless textures, this image turned out virtually seamless so I added a distinct bevel to the edge for demonstration purposes. There are endless ways to create texture effects, and the focus of this tutorial is on basic tiling techniques that will work with any image. Most paint programs have automatic seamless tiling features, which work with varying degrees of success. Knowing how to tile manually is still vital however, especially if you're working from a photo base.

Using Half Wrap

Click for a larger image This is the base image with the Half Wrap filter applied. This filter offsets the image by 50% horizontally and vertically, effectively moving the edges to the middle. Photoshop has an Offset function that will do the same thing. The edges of the texture are clearly visible now as horizontal and vertical lines through the center. If I wanted the texture to look like actual floor tiles, I could just darken these lines and be done with it. But our object here is to blend in the edges so smoothly that you can't tell where the texture repeats. Depending on the source image, the seams could be very subtle, or even more pronounced than this, with pattern mismatches instead of the simple straight lines seen here. Even subtle tiling artifacts will be very apparent when a texture is tiled many times. To make the texture tile properly, we have to get rid of these.

Cutting and Pasting

Click for a larger image To get rid of the vertical seam, I copy the highlighted part of the texture . . .
Click for a larger image . . . and paste it over the seam. Feather your selection a bit, and rotate it 180 degrees so it doesn't look exactly like the source area.
Click for a larger image The vertical seam is now less obvious.
Click for a larger image Repeat the copying and pasting process for the other seams, and this is the result.
Send in the Clones: Using the Clone Brush

Clone brush Tool Options Palette Now we have to blend our pasted selections into the surrounding areas. The clone brush is perfect for this. The clone brush is used to paint part of an image from one area to another. You right-click to define the source area, then left-click to paint that part of the image over another area. I was intimidated by this tool at first, but it really is easy to learn. For a thorough overview of the clone brush, click here. Photoshop has a similar tool called the Rubber Stamp. When using the Clone Brush, try to extend the patterns of the texture so they extend smoothly across the seam. Again, this sounds complicated but is very easy to pick up. After some practice you'll quickly be able to see which areas will make good sources to clone out visible seams.
Click for a larger image After some cloning, the seams are gone. Now apply Half Wrap again to put the texture's edges back where they belong. Once that's done, you can look at how it tiles and check for artifacts.
Check the Tiling

PSP 7 has a cool new feature that lets you check your texture's tiling without having to start up UnrealEd and apply it in a level. Select the Flood Fill tool, then choose Pattern as the fill style. The image you're currently working on will appear at the top of the pattern list. Open a new 512 x 512 image, and fill it with your texture at 50% size. This will show your texture tiled 4 times.
Click for a larger image Here, you can see an artifact --- there is a darker area in the upper right portion of the texture that repeats visibly when tiled. It's fairly subtle, but should be fixed.
Click for a larger image A few seconds with the Retouch tool (mode Lightness Up, low opacity), and the dark area is no longer very noticeable when tiled. Keep in mind that reducing image size and colour depth can introduce artifacts that aren't there in the full-size texture. Compare the thumbnail of this image with the full-sized one.
Remember that you don't have to get rid of every single feature that stands out when the texture is massively tiled. If you do that, you'll be left with a featureless blob. This simple patterned type of texture is called a "base" texture, and if you load up any of the Unreal base textures and slap them on a wall, you can count how many times they tile --- if you're looking for it. Base textures aren't intended to cover huge areas though; they should be used for places where a lot of detail isn't needed. Check out this article for some good texture usage advice.

When you're satisfied with the results, it's time to reduce the size and colour depth of the texture. 256 x 256 or 128 x 128 are good sizes for wall textures. To preserve image quality, it's a good idea to shrink the image halfway, sharpen, then shrink to the final size. In the Color menu choose Decrease Color Depth and choose 265 Color (8-bit) ---this is the format UnrealEd works with. Save the image as .pcx and you're ready to import your new seamless texture into UnrealED!
Click for a larger image The final product. Click here to download the .pcx version.