Hello,<br><br>I'm working on a program that will draw me a metallic 3D texture.  I successfully made a Perlin noise implementation and found that when the result is blurred in one direction, the result actually looks somewhat like brushed aluminum.  The plan is to do this for every n*m*3 layer (2D texture) in the 3D texture.  <br>

<br>My solution to this anisotropic blurring looks like:<br><br><span style="font-family: courier new,monospace;">soften = layerarray.copy()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">total = 1</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">for bluriter in xrange(1,5,1):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    soften[:,bluriter:]  += layerarray[:,:-bluriter]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    soften[:,:-bluriter] += layerarray[:,bluriter:]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    total += 2</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">soften /= total</span><br><br>Where <span style="font-family: courier new,monospace;">layerarray</span> is a n*m*3 array, and <span style="font-family: courier new,monospace;">soften</span> is the array that will be converted into an image with the other 2D images and saved.  <br>

<br>This code successfully blurs the array in the y-direction.  However, it does not do so the way I would like.  The blur is accomplished by a simple shift, making the arrays not line up.  This leaves space at the edges.  When the final <span style="font-family: courier new,monospace;">soften</span> array is divided by <span style="font-family: courier new,monospace;">total</span>, those areas are especially dark.  Visually, this is unacceptable, and leads to banding, which is especially evident if the texture is repeated.  As you can see in this image, which shows about 6 repeats of the texture, <a href="http://img13.imageshack.us/img13/5789/image1wgq.png">http://img13.imageshack.us/img13/5789/image1wgq.png</a>, the dark edges are annoying.<br>

<br>I made sure, of course, that the Perlin noise implementation is tileable.  The solution to my problem is to make the shifted array wrap around so that its overhang fills in the hole the shift caused it to leave behind.  For example, to simulate shifting the texture 8 units up with wrap, the first 8 rows should be removed from the top and added to the bottom.  Likewise for columns if the blur goes in that direction.<br>

<br>I already tried a couple of times at this, and it's not working.  I need a way to blur <span style="font-family: courier new,monospace;">soften</span> by column and by row.<br><br>Thanks,<br>Ian<br>