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.
-