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

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s