Using a Pink-ratio fitness test to develop pleasing distributions of colored pixels.


You can download the source code and play with this all you like. If you make any improvements, I'd greatly appreciate if you let me know. The files are all in one zip file: poofz.zip. Note: I lost my most recent copy of Poofz. This is a very old copy that contains much of the code, but almost none of the user interface.


Mostly Complete
The program functions as it should. It could really use a more complete user interface. Continued development is in metrics for the AI's fitness checks.
The best thing to come out of this project is the balance meter. It shows the top 10 rankings of a metric in vertical bars. If all bars are level, the metric is balanced. If they are too high, it is randomized. If they are too low, it is monotonous.

To Do

Create more metrics to guide the art creation.


At the College of Charleston Computer Science Department, I worked on a project that tried to detect 'Zipfian balance' in music. The term 'Zipfian' is the same as '1/f' or 'Pink'. I learned that it refers to a balance of frequencies. When ordered from most frequent to least frequent, the second rank is 1/2 as common as the first rank. The third rank is 1/3 as common as the first rank. The n'th rank is 1/n as common as the first rank.
The assumption of the project is that good music does have such a balance. I went with that assumption and worked on having a computer write random music that has the proper balance. The problem is that the metrics of measuring the balance in music are very complicated hard to justify.
I then went with the idea that the same balance exists in artwork and wrote a program to create random art with the proper balance. The metrics are easier to explain. For instance, you can get a balance of the color of the pixels used. You can get a balance of the brightness of the pixels used. You can get a balance of the difference in color between neighboring pixels.
I needed a name and I combined Pink, One-Over-F, and Zipf into Poofz.


Poofz is written in Java because I bounce between a Windows machine and a Linux machine. I don't want to write two GUI interfaces. Also, I don't fall for that 'Java is so slow' propoganda.
The AI is a simple survival of the fittest algorithm. I randomly pick a pixel of the artwork. I then randomly pick a bunch of colors to try in that position. The color that gives the overall artwork the highest rating is kept. Then, repeat.
I have tried starting with a blank block of pixels and a set of completely random pixels. It isn't any faster in either situation, but when you start with an all-white set you are pretty much assured that you'll have a lot of white in the end product.
Finally, the test. I used an 8x8 set of pixels. I also did tests with up to 128x128, but it runs very slow at that size. I start with a random sample. (left image) I then run it through a bunch of generations - about five minutes worth. I get a result that is obviously more pleasing, but I wouldn't really call it art (right image).

You've read it. You can't unread it.
Copyright ©1998-2023 C. Shaun Wagner. All rights reserved.