I am looking for a way to apply (Photoshop, Gimp etc.) filters to seamless textures without the usual border artifacts. The kernel of the Photoshop Gauss filter for example does not wrap around the image (which in non-seamless cases is surely also not wanted) but shows severe artifacts at the borders. Is there any way around this?
Just fake the wrapping (I assume we're talking about working in Photoshop/Gimp and not doing it at runtime in a game):
- Depending on your editor there might be an easier way to do this.
- Double the size of the canvas while keeping the original image in the center (i.e. don't scale it).
- Copy/tile the actual texture to fill the (still blank) space outside the original image.
- Apply the filter.
- Downsize the canvas again to the original size, keeping the image aligned to the center.
Here's what I do: Duplicate your image into two layers, then on one of the layers use Filter>Other>Offset half the width and height. Apply your Gauss filter to each layer, offset the layer by half again, and use the eraser on the top layer to blend them together.
Edit: Make sure you use the Wrap Around option in the Offset filter.
On the top left is my original image. Top right is the top layer after applying an offset and then using Gaussian Blur. Bottom left shows the re-offset top layer with the erased area highlighted in red. On the bottom right is the final image.