Neural Network Painter

I created this project to create nice background images for my blog. I wanted to have a network of colourful neurons connected in such a way that the image could be tiled and repeated. While the development was interesting, the resulting images weren't quite as amazing as I hoped, which is why these images didn't get used as backgrounds. I did however create a smaller version as a favicon. Here you can see how this may have looked like.

On the settings panel several adjustments can be made. Users can change the tile dimensions, amount of neurons per tile, the seed for the internal random number generators, the min and max amount of connections going in and out of neurons, the connection type, the lines straightness, visualisation options and whether or not neurons are allowed to overlap. All changes to the settings are read from and stored to a .properties file.

The different types of lines and other options are shown in the image carousel.

The code can be found on my gitbub repository while an executable .jar file can be downloaded here. The .jar file linked here might not always be up to date as I don't want to reupload it to the blog each time I make minuscule changes.


Main UI window along the settings window

Main UI window along the settings window

The UI of the main window has three buttons: One to save an individual tile, one to save the whole currently displayed picture and one to open the settings panel. On the settings panel one can change all sorts of options to create images of their liking. In order to create the favicon I used for this website I changed the tile dimensions to 32x32, Neuron count to 5, the seed to 54, Min/Max connections to 4 and Min/Max neuron size to somewhere around 8-12. Also you need to set the Line algorithm to "Paris City Block", uncheck the "Paint background" option (so that the resulting image has alpha) and uncheck "Create connected Tiles" (so that the lines don't connect to neurons on neighbouring tiles like in the UI image shown).

Antialiasing for line is pretty new which is why the lines in the images in the carousel look that nice. The reason for that is that a previous version of the algorithm would draw the lines pixel per pixel (side effect of the straightness parameter) which doesn't benefit from the Antialiasing. Since a more recent version the lines are drawn as full strokes when straightness==1.