Nature of code Final: pixel sorting

Inspired by Jeff Thompson’s GitHub (, I’ve made my own tryings.

Firstly, I selected a video and automated it into a gif file through terminal. (Not necessary for this project, just did it for fun)

The original gif file is like this (yeah this is my friend Jade):

Based on what Jeff said:

This particular script loops through both the columns and the rows of the image, but it doesn’t pixel sort the entire column or row, if it did, the result would look more like a blank gradient than anything interesting. Instead for each column and row it looks for a pixel to start sorting on and then it looks for a pixel to stop sorting on — this makes the algorithm somewhat intelligent resulting in identifiable elements of the image being left untouched.

So I tried different mode to decide which pixel to start sorting on, and which to stop.

Black Mode:

Brightness Mode:

White Mode:



Subtraction Final Project

I built this project inspired by a segment from a film: A Chinese Odyssey.

In this segment, the faery enters the hero’s heart and finds who he really loved, then she leaves a tear in his heart.

Since this film is being re-shot recently, I strongly want to make something to show my respect to it.

So I decided to make a heart which can contain something like a tear.