Removing Brightness Variation To Make Tileable Textures
By Neil Blevins
Created On: Sept 25th 2005
Updated On: Nov 21st 2008

Say you have a texture fragment you want to make tileable, but it has some big areas of light or dark such as this...

Figure 1

Notice how the lower left corner is really darker than the rest of the image. If we try the offset trick, we get this...

Figure 2

This is going to be really hard to use the clone brush on, because the seam area is so different, one side is really dark and one side is really bright.

Here are a few techniques for fixing the problem.

High Pass Filter Method

The high pass filter lets you remove large changes is brightness without removing the small changes in brightness. And that's what we're after here, we want the large changes in brightness to go away (the dark left corner), but we don't want to obliterate the small changes in brightness which are the cracks in the rock.

The procedure is like this, take your first image, duplicate it as a new layer. Then run the Filter -> Other -> High Pass on your duplicated layer. Play with the Radius until you've gotten rid of the dark corner, but still have the small rock cracks. For this example, I used a value of 28.0. Smaller values will remove the smaller details, whereas larger values only remove the large brightness changes. Experiment to find the ideal value for your particular image.

Figure 3

This is the result of the filter...

Figure 4

Now take that duplicated layer and set the mode to Luminosity...

Figure 5

The reason to do this is because the high pass filter can change the colors of your image pretty radically. For example, if you look at the image above, running the low pass filter on the background copy layer made the rock much yellower than the original rock. So you want to keep the color of your original image, but use the brightness information of your high pass filtered image, hence you set the layer to luminosity.

Now when you use offset on the result, it looks much better, and you can use this technique to remove the seam (Note: Before offsetting, flatten your image, otherwise, you'll only offset your top layer instead of the combination of both layers.)

Figure 6

For more information, here's a more in-depth article discussing the technique...

Gamasutra - "The Power Of The High Pass Filter"

Gradient Method

Another method is the gradient method. This technique gives you more control over the final result, although it's not as automatic as the high pass filter method.

First, start by applying a new Adjustment layer, set to Levels. Brighten the image by some arbitrary amount, don't worry by how much just yet, we'll tweak that later.

Figure 7

Now on the Layer Mask of your Adjustment layer, place a black to white gradient, so that the adjustment layer is only applied to the left side of the image.

Figure 8

Now use the Offset filter to move both the base layer and the adjustment layer half way horizontally. In this case, the image is 400 wide, so move it 200 pixels to the right.

Figure 9

Now adjust the levels amount until the brightness matches pretty close in the middle.

Now do the same thing, except add a new Levels Adjustment layer, and offset the image 200 pixels vertically instead of horizontally. Also, feel free to paint on either of the levels masks to get specific areas brighter or darker. Soon, you'll get a more level result like this...

Figure 10

Then use the clone brush to dispose of the seam.

Thanks to Justin Goode for some useful info with regards to the gradient technique.

Shadow/Highlight Method

In more recent copies of photoshop, a new Adjustment has been added called Shadow/Highlight.



Here's the dialog it opens, notice the controls for the dark and bright areas of your image. Playing with them can help give you level the value across your image without losing the small details.



And here's the result on our image after the settings above were applied and after I used the offset filter to see how well it did evening the image...



A little work with the Clone Brush, and this may be good enough to give you your tiling bitmap.

Conclusion

Knowing when to use which technique will take some experience. Personally, I'd start with the most automatic method, and try the Shadow / Highlight Adjustment first if you have a later copy of Photoshop. If that doesn't seem to do a good enough job, I'd probably give the high pass method a try, but that technique can mess with your colors and the contrast of your texture in some cases. If you find that technique isn't working, then try the gradient method, it may do a better job, although the process is more labor intensive.


This site is ©2023 by Neil Blevins, All rights are reserved.
NeilBlevins.com Twitter Mastodon Bluesky Instagram Blogger Facebook LinkedIn ArtStation Kickstarter Gumroad YouTube IMDB