Categories
etcetera

Image Quadrangulation

I want to represent an image with a bunch of rectangles. Let’s say that each shape has constant color, as a start. First, fill a rectangle with the average color that it covers. That’s the initial approximation. Wherever the error in a rectangle (between the original image and the approximation) is too big, subdivide that […]

Categories
etcetera

Pulled String Art

Check out this art style! They dip a string in ink, lay it on a page, fold the page over, and pull the string out of the bottom. It leaves nice floral patterns with the ink, and is pleasantly complex and organic. I wanted to mimic this style algorithmically, so the first thing that I […]

Categories
etcetera

Solving Tic Tac Toe, Making it Interesting?

Tic Tac Toe (TTT) is a minimally complicated game, so it is relatively easy to find all possible moves and see which will lead you to a victory, tie, or loss. I’ve never solved TTT before, so I threw together some code to do that! Solving Tic Tac Toe Without removing boards that are effectively […]

Categories
etcetera

Messing with Image Classification

There’s so much buzz about image recognition these days, I felt like I wanted to join in. Long ago, I saw an excellent project by Tom White in which he used image classification to generate abstract drawings reminiscent of an object. Basically, he made a feedback loop between an image generator and the image classifier, […]

Categories
etcetera penplotter

FFT-based Line Smoothing

With a jagged or noisy signal, Fourier filtering can be pretty useful for cleaning up the unwanted noise. Line drawings can be considered signals just as easily as time-varying signals, so let’s get ready for some Fourier transforms! The basic idea of smoothing (with length scale L) a polyline with a Fourier transform: Re-sample along […]

Categories
etcetera penplotter

Chaikin-like Smoothing, Through Vertices

The standard Chaikin smoothing is a corner-cutting algorithm, which leads to nice results, but it no longer passes through the vertices of the original path. In cases where we trust the vertices more than the segments, what are we to do? Well, invent a new method, of course. Ideally, I want to give this method […]

Categories
etcetera

Image Orientation

I want to get a sense of the local angle of features in an image. This is a tall order at times, and isn’t even clearly defined. Do you want to follow the local gradient of the image? Be parallel to lines? We’ll try various methods and see what works. I’ll show a comparison of […]

Categories
etcetera

Generative Lumber

Wood is a curious material. You can see its history in a slice, due to its imperfect rings. I wanted to recreate a simplified version of this. First, I created a skeleton of line segments to represent the trunk and branches. From these, I created a 3D distance map. If I plotted the contours of […]

Categories
etcetera

Splash!

I’ve been wanting to generate patterns that look like splashes. It’s tempting to simulate attractive particles flying through the air, and then see where they intersect the ground, but that’s more intensive than is necessary. Instead, I pretended to throw some metaballs at the ground: Those look like splashes to me! To generate these required […]

Categories
etcetera

Ambiguous Digits 2: Generative Adversarial Network

I’m still interested in making ambiguous-looking numbers. Last time, I trained a neural network to identify pictures of handwritten numbers, and then used that to create images that look like one digit when right-side-up, and a different one when upside-down. This time, I’ll use a Generative Adversarial Network (GAN). A GAN is a pair of […]