Once I’ve opened Telegram and seen this:
🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕 🌕🌕🌘🌑🌓🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕 🌕🌕🌑🌕🌕🌕🌗🌑🌑🌑🌕🌕🌕🌕🌕 🌕🌕🌑🌕🌕🌖🌑👁🌑👁🌔🌗🌑🌕🌕 🌕🌕🌘🌓🌕🌑🌑🌑🌑🌑🌔🌕🌘🌔🌕 🌕🌕🌗🌑🌘🌑🌑🌑🌑🌑🌕🌖🌑🌕🌕 🌕🌕🌕🌘🌑🌑🌑🌑🌑🌕🌖🌑🌔🌕🌕 🌕🌕🌕🌖🌑🌑🌑🌑🌑🌑🌑🌔🌕🌕🌕 🌕🌕🌕🌗🌑🌑🌑🌑🌑🌑🌕🌕🌕🌕🌕 🌕🌕🌕🌘🌑🌕🌕🌘🌑🌔🌕🌕🌕🌕🌕 🌕🌕🌕🌑🌓🌕🌕🌗🌑🌕🌕🌕🌕🌕🌕 🌕🌕🌖🌑🌔🌕🌕🌖🌑🌔🌕🌕🌕🌕🌕 🌕🌕🌗🌑🌕🌕🌕🌕🌑🌑🌕🌕🌕🌕🌕 🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕
(thank you, @folex)
And that’s how idea was born.
-
Install Processing 3
-
Open the
bad_apple_emoji.pde
file in Processing 3 and press ▶ button (or Ctrl+R) -
Change it! You can play around with output size, tile size, select one of two available emoji themes, or get creative and write some more code!
-
Split frame into tiles. Each tile will have a single emoji.
-
For each tile:
-
Split tiles horizontally into 4 vertical regions.
-
Average each region color, calculate it’s brightness, and check if it crosses threshold.
-
Calculate perceptual hash of the tile: set corresponding to the region bits in range 0:3 to 1 if the region is brighter than the defined threshold and 0 if it’s darker.
-
Lookup image from table that matches such hash (table constructed manually, with approximations)
-
Draw corresponding image at the current tile.
-