Pixel Sorting in Processing (Java)

Pixel Sorting 1 Apr 2017 8

Today Simon showed me what he learned about pixel sorting in Processing (Java) by doing this coding challenge by Daniel Shiffman. Using a “selection sort” algorithm, he sorted the pixels of a sunflower image by brightness and hue. The results were amazing, it had this impressionistic effect, like a Van Gogh painting. Maybe Van Gogh also sorted pixels?

Here the pixels are sorted at random in black and white:

Pixel Sorting 1 Apr 2017 1

Here Simon added max RGB values:

Pixel Sorting 1 Apr 2017 2

Here the pixels are cloned from the image on the left:

Pixel Sorting 1 Apr 2017 3

The same, but in an easier way, by using the img.get() function:

Pixel Sorting 1 Apr 2017 4

Pixels sorted by brightness:

Pixel Sorting 1 Apr 2017 5

Pixels sorted by hue:

Pixel Sorting 1 Apr 2017 6

Beautiful, isn’t it?

Pixel Sorting 1 Apr 2017 7

 

Leave a comment