Hey guys, I'm trying to figure out how to generate tileable fractals in code (for game maps, but that's irrelevant)
I've been trying to modify the Solid Noise plug-in shipped with GIMP (with my extremely limited understanding of how the code works) but I cant get mine to work correctly.

So if anybody can see what I've done wrong, or has a suggestion how I could go about doing it differently, I'd greatly appreciate it. Thanks in advance.
And if I'm asking way to much or if just a huge failure at life, I apologize.

It seems as though my original pastebin expired somehow, so I have no way to compare my nonworking code, but on my current game I went through and translated the GIMP code into java again and it seems to work fine now.

If anyone plans on using this code, I'd recommend modifying the constructor to modify the setting parameters (detail and size) so you can make it work how you'd like. EDIT: I realized my original question was about making it tileable, so remember to set tilable to true!

I recommend you use the diamond-square algorithm, also known as plasma fractal or random mid-point displacement fractal. Using this algorithm it is very easy to constrain the edges to have the same values. When you generate a value for an edge, copy it to the corresponding edge on the other side. This yields a perfectly tiling map.

There's a great article about noise generation here. It's not Perlin noise as the article claims (it's pink noise actually), but it is still incredibly useful to understand how noise images are generated.

So, to actually answer your question: to make a tileable noise image, you just need to keep "tileability" throughout the generation. That is, when noise is smoothed, you smooth it as if it is repeated infinitely in all directions - tiled.

From the screenshot, my guess is that only the "big" layers are being generated, which is why the noise appears too regular and lacks detail.

This may sound stupid, but did you try increasing the "detail" variable (line 16)? In your code, it's set to 1, which means the algorithm will only generate two layers of detail before stopping. Try increasing it to something like 8.