Building patterns for GIMP so they can easily be used when creating textures
Before we begin with GIMP, take a few moments just to mess around with the features. Create a random image, use all the filters, use all the Script-Fu plugins. Randomly stumbling upon some combination of filters or interesting seeds into a plugin can create some interesting art.
- Find an easy way to create a red and blue grid
- Find the Fractal Explorer and dork around with it. It's nifty
Building Textures for GIMP
Textures can be anything; squiggly lines you sketch, a scanned-in image, a digital photograph or some procedurally (or programatically) generated. The tough part is trying to find a way to make textures look smooth without seams or abrupt edges. No matter if its on a character model or a wall on a map, you need to ensure your textures can reoccur and not look to jarring next to adjacent textures.
The easiest way to do this is by building a pattern for GIMP, then applying this pattern to a larger image. Patterns are just small images that are specially designed to reoccur; such as bubbles or a tartan pattern might repeat across someone's desktop. By using patterns we can build better textures without having to manually match up seams against seams.
Starting With an Image
Let's start with a random digital image of carpet. Initially it looks awful; there are large occluding shadows, light is uneven and its bigger than what we need. Our first step is to crop our image so we just have the content we like. It's best of our proportions are equal and our image width and height is a power of two, such as 768x768. This will allow us to more efficiently use the image when applying it as a texture to a 3D mesh.
Next, scale your image down to a reasonable size less than 512 pixels wide. For this purpose, we'll just use an image size of 128x128 pixels.
|Our carpet, cropped and scaled||Our carpet, made seamless|
Next, chose Filters->Map->Make Seamless. You'll notice that the corners of the image turn inward a bit and the edges become a bit altered. It may not at first look like it, but GIMP has magically adjusted your image so that multiple copies of this image tiled together will look like a single, seamless carpet. Go ahead and try it out!
Creating GIMP Patterns
Now we're ready to use this image as a GIMP pattern. Find your GIMP user settings directory; either ~/.gimp-2.2 in Linux or somewhere in C:\Documents and Settings\Username in Windows. Save the image as a GIMP pattern (*.pat) in your user settings directory within the patterns/ folder. For example, I saved mine as ~/.gimp-2.2/patterns/carpet.pat.
Once your file is saved, open up your patterns dialog in GIMP (Shift+Ctrl+P). Hit the refresh icon at the bottom-right hand corner, and you should see your new pattern pop up in the list.
Create a new image of any size then use the bucket fill to fill the entire image with your new pattern. Ensure that it looks consistent and seamless throughout. Your eye will probably notice some reoccurring patterns in the image; if you wish, now is the time to even the pattern out or even make it more prevalent. For example, a carpet should be even in texture across the image, but ceramic tile should definitely have repeating sequences.
This same technique should be applied whenever you need a uniform texture, such as with hair, skin, concrete, floors, etc. Using GIMP's many filters, plugins, effects and distorts you can even start an image from scratch then create a realistic material pattern.