I want to have the ink on a photo clump together, leading to a black and white image. This is a sort of flow, so my first thought isr to take a look at the advection-diffusion equation. Let’s say that the ink distribution across an image is , the diffusion factor is , and the […]

# Category: etcetera

Previously, I took one photo and rearranged its squares to make a version of another photo. How about a sillier version, where you use one image to re-make itself? The simple answer is to just keep every square in its original place, but that’s no fun at all. Instead, we can add the requirement that […]

In my previous post, I did some statistical analyses of the Dresden Files novels. Now I want to do some fancy stuff with vectors. Word2Vec is a method for turning a bunch of words in text into related vectors, as the name implies. Using a shallow neural network, it represents finds vectors such that words […]

The Dresden Files is a series of very fun books by Jim Butcher, with a wizard detective getting into trouble and saving the world and all that. I’ve wanted do do some Natural Language Processing (NLP) on a body of text, and with fifteen novels so far (two more later this year!), this is a […]

Previously, I recreated an image by rearranging squares of another image. Typical photomosaics allow for repeated use of tiles, so I’ll try that for comparison. I’ll still allow rotation, as it helps the edges so much. The image on the left is the result: It works, but isn’t great. The repeated use of certain tiles […]

I want to take one image, chop it into square tiles, and use those to make an approximation of another image. When the images are the same size, the simplest version is identical to the assignment problem. This is a classical optimization problem that has been well studied. In those terms, there is a “cost” […]

I want to approximate images using constant-color shapes. Given a shape, how do we choose where to put it? We have the original image, , and the approximate image, . I want to place a shape, , with area on such that it improves the approximation. First, define the average color under the shape (which […]

## Angled Splitulate

I’ve refined image approximations with rectangles and triangles. Let’s try with splitting regions into two with a straight line, and filling each part with the average color that they’re covering. This is the same basic idea as the rectangles, except that now the line can be at any angle, rather than just vertical or horizontal. […]

## Image Triangulation: Voronoi Method

Voronoi diagrams are great, so let’s use them to stylize images. First, let’s just throw a bunch of points on an image, and compute the Voronoi diagram. Then for each cell, we fill it with the average or median color within: Hmm. That’s not great. It doesn’t pay attention to the edges at all, and […]

## Image Triangulation

Previously, I split an image into a bunch of rectangles. What about using triangles? This requires more thought, as it’s a little trickier to divide up the plane using triangles. The natural solution is to keep track of a set of vertices, then use a Delaunay triangulation to split up the image. First, let’s do […]