Is it possible to encode and compress an image to such a degree that the raw data can fit in a single Twitter message (140 characters) that, when decoded again, is still recognisable? The answer to the questions is a resounding Yes, as confirmed by a coding challenge inspired by Mario Klingemann’s attempt to compress and encode the Mona Lisa down to 140 characters.
Klingemann’s attempt, dubbed the MonaTweeta II, is definitely an image recognisable as the Mona Lisa, but it must be said that some of the entries to the main coding challenge are truly breathtaking.
The winning tweet (withÂ a character to spare):
å’ç’˜é©žå‡„è„’éµšæ®è›¥é¸‚æ‹—æœæœ–è¾¿éŸ©ç€¦é·æªç—«æ ˜ç’¯ç·è„²è•œæŠ±æŽé »è“¼å‚µé‘¡å—žéŠå¯žæŸ®åš›åšµç±¥èšéš¤æ…›çµ–éŠ“é¦¿æ¸«æ«°çŸæ˜€é°›æŽ¾æ’„ç²‚æ•½ç‰™ç¨‰æ“Žè”èžŽè‘™å³¬è¦§çµ€è¹”æŠ†æƒ«å†§ç¬»å“œæ€æ¾èŠ¯è¶è¾æ¾®åžé»Ÿåžåª„ç«¥ç«½æ¢€éŸ é•°çŒ³é–ºç‹Œè€Œç¾¶å–™ä¼†æ‡å©£å”†é¤è«½é·é´žé§«æ¶æ¯¤åŸ™èª–èœæ„¿æ—–éž°è—å‹¹éˆ±å“³åž¬æ¿…é¬’ç§€çž›æ´†è®¤æ°—ç‹‹ç•°é—¥ç±´çµä»¾æ°™ç†œè¬‹ç¹´èŒ´æ™‹é«æåš–ç†¥å‹³ç¸¿é¤…ççˆ¸æ“¸è¿
Roger Alsing used a genetic algorithm to create a brilliant approximation of da Vinci’s Mona Lisa using only 50 semi-transparent polygons, evolving over approximately a million generations.
You can see the end result, after 904,314 generations here, but even after roughly 100,000 generations the image is impressive. I loved scrolling through the pictures, slowly seeing the finished article appearing.
Why does the woman depicted in the Mona Lisa appear to be both smiling and not smiling at the same time? The smile part of the Mona Lisa’s face was painted by Leonardo in low spatial frequencies. This means that when you look right at her mouth, there’s no smile. But if you look at her eyes or elsewhere in the portrait, your peripheral vision picks up the smile.
I’ve heard this before, but I’m posting this today because I recently read this great quote from Stanley Kubrick:
How could we possibly appreciate the Mona Lisa if Leonardo had written at the bottom of the canvas: ‘The lady is smiling because she is hiding a secret from her lover.’