I wanted the ability to manipulate images in Scala with elegant syntax to make it possible to whip up an interesting little visualization or piece of art quickly. It works by creating a wrappers around the Java image and color classes. It also makes it really easy to read and write image files in Scala.

Images generated with scala-image


K-means on pixels, with the distance function mapping to spacial distance


K-means with distance function using color distance


Running K-means as above, but with color labels from


Squares of the color of the pixel they cover are randomly placed, and the square widths decrease over time.


I run an edge detector on the image, then make the hue map to the direction of the edge. Then I do the same delta trick to spin it.


A simple program trying to find the optimal split between some data points with brute force.


Some particle floating around. If they get close, a line forms between them and they pull on each other


Each pixel's color is a function of its angle and radius from the center. I add a delta to the angle over time to make it spin.

Built With

Share this project: