All Projects → gabrieloc → Emojivision

gabrieloc / Emojivision

A 200 something line Swift Playground for rendering images as emojis

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Emojivision

Visualprogramminglanguage
Visual programming language written in Swift that assembles to executable Swift code. WWDC '18 scholarship submission.
Stars: ✭ 1,145 (+1263.1%)
Mutual labels:  playground
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-10.71%)
Mutual labels:  playground
Embed Js
🌻 A lightweight plugin to embed emojis, media, maps, tweets, code and more. ✨
Stars: ✭ 1,220 (+1352.38%)
Mutual labels:  emoji
Ideogram
Insert emoji anywhere in elementary OS, even in non-native apps
Stars: ✭ 68 (-19.05%)
Mutual labels:  emoji
Rime pure
【rime小狼毫\trime同文】手机/PC一站式配置【简约皮肤\拼音搜狗词库\原创trime同文四叶草九宫格拼音方案\四叶草拼音、小鹤双拼、极品五笔、徐码、郑码】 rime配置
Stars: ✭ 73 (-13.1%)
Mutual labels:  emoji
Emoji
A simple library to add Emoji support to your Android Application
Stars: ✭ 1,201 (+1329.76%)
Mutual labels:  emoji
Emojis List
Complete list of standard emojis.
Stars: ✭ 65 (-22.62%)
Mutual labels:  emoji
Qq Wechat Emotion Parser
QQ、微信表情符号解析:字符串到图片URL
Stars: ✭ 82 (-2.38%)
Mutual labels:  emoji
Phpumoji
PHPUnit Emoji Result Printer
Stars: ✭ 75 (-10.71%)
Mutual labels:  emoji
Emoji
emoji terminal output for Python
Stars: ✭ 1,215 (+1346.43%)
Mutual labels:  emoji
Codefont
60余种常用的等宽字体 愉快的code吧 欢迎issues我 收录更多字体 Happy code bar with more than 60 common fonts of equal width. Welcome issues. I include more fonts.
Stars: ✭ 68 (-19.05%)
Mutual labels:  emoji
Hexo Filter Github Emojis
github emojis for hexo! 🎉
Stars: ✭ 71 (-15.48%)
Mutual labels:  emoji
Rails emoji
Emoji for Ruby on Rails
Stars: ✭ 76 (-9.52%)
Mutual labels:  emoji
Audiokit
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
Stars: ✭ 8,827 (+10408.33%)
Mutual labels:  playground
Pixelartmaker
A pixel art editor in a Swift Playground 👾 WWDC Scholarship Winner 🏅
Stars: ✭ 79 (-5.95%)
Mutual labels:  playground
Codeworld
Educational computer programming environment using Haskell
Stars: ✭ 1,142 (+1259.52%)
Mutual labels:  playground
Laravel Smartmd
🎯 A simple markdown editor compatible most markdown parse,You can choose any parse methods on server or client,like Mathematical formula、flowchart、upload image...
Stars: ✭ 76 (-9.52%)
Mutual labels:  emoji
Black Playground
ambv/black online demo
Stars: ✭ 83 (-1.19%)
Mutual labels:  playground
React Native Animated Emoji
Animated Floating Reactions like Facebook 👍
Stars: ✭ 82 (-2.38%)
Mutual labels:  emoji
Metalbrot Playground
An interactive playground showing how to use Metal compute kernels.
Stars: ✭ 78 (-7.14%)
Mutual labels:  playground

✨👯‍♀️emojivision👁👄👁👯‍♀️✨

A 200 something line Swift Playground for rendering images as emojis.

Update Emojivision is now out for iOS! Get it here!

emojivision

At the top of the file are a few constants:

  • imageFileName - The input image
  • colorMapName - The palette to sample from
  • emojiFileName - The file to generate the palette from
  • resolution - EmojiDensity™

Included in the source is a dump of all iOS12 emojis (sourced from EmojiDump). The function generateColorMap reads that file and exports a newline-separated text file containing the dominant color in each emoji to ~/Documents/Shared Playground Data/colormap.txt. You can replace that file if you want to populate your palette with more emojis, but you'll need to update the file specified by colorMapName if you want it to be used.

You'll notice that the included color map has far fewer entries than the comprehensive emoji dump, which is a performance requirement. Here's how it works:

  1. Go through every few pixels of the image (specified by resolution) and get the color of that pixel
  2. Treating each color's rgb as a 3d vector, compare the euclidian distance of that color with every color in the provided palette, and get the color with the nearest distance
  3. Get the emoji associated with that color value from a precomputed dictionary of colors to emojis
  4. Draw the emoji in the rect occupied by the current pixel with dimension specified by resolution

For your convenience, code at the end of the file outputs your artwork to ~/Documents/Shared Playground Data/out.png. Note that this directory needs to exist beforehand 🙄.

PS: this was done as a proof of concept and the right way to do things would be to offload more to the GPU, such as finding nearest colors and rendering of emojis 🤷‍♂️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].