mosimoji
make an emoji mosaic of from your picture
getty
npm i -g mojimosi
usage
npx mojimosi [options] <image>
options
option | type | description |
---|---|---|
--tilesize , -t |
number | the number of pixels an emoji should represent |
--background , -b |
string | a colour like "white" or "#ff2a50" to use in place of transparent tiles |
examples
eat more pixels per emoji
npx mojimosi -t64 friend.png > friend.txt
dark mode
npx mojimosi -b black -t12 lol.png | pbcopy
thanks
- to @InboxAppCo who made the MIT licensed emoji extractor that's been subtree'd in, but is not a runtime dependency
- to @DavidBarts who made the getfonts package that's been illegally subtree'd in. they took a lot of flack for it on reddit because of IANAL but EULA amirite, and it's unlicensed so i've included their copyrighted code in this project.
- Mihai Potra whose MIT licensed find-color script is included here with some features removed to make it work for me
- everyone who made any of the dependencies
- the people i love and the people who love me and most especially the intersect
story
the first thing i did was i extracted the TTF (true type) font files from the
TTC collection at /System/Library/Fonts/Apple Color Emoji.ttc
using the
getfonts
script that's subtree'd in here, but was written by @DavidBarts (who
posted about it on reddit and then everyone told them they were bad). then i
extracted the emoji from the ttfs using the extract-emoji
script here, that
was by @InboxAppCo (or by @devangovett according to the package.json).
then i created a plain text file that i've called database
to
annoy rich hickey, which contains one-per-line of: emoji red green blue alpha
,
of the average colour of the image reported by the image-average-color
npm package.
then, the picture that's given on the command line is sliced up into a grid the size of the [tilesize] provided on the command line (defaults to 32), then the average colour of each slice is matched as closely as it can be (by Mihai's find-color script) to one of the emoji average colours, then the emoji are printed out in that same grid.
about the author
๐ ๐ ๐ ๐ณ โฐ ๐ ๐ฆ ๐ซ ๐ฒ ๐ป ๐ ๐ป ๐พ ๐ง ๐ง ๐ ๐ ๐ป ๐ฉ ๐ง ๐ฉ ๐ฆ
๐บ ๐บ ๐ ๐ ๐ ๐ ๐
๐ ๐ซ ๐ฏ ๐ช ๐ ๐ซ ๐ฒ ๐ป ๐ฅ ๐ฅ ๐ง ๐ง ๐ง ๐ง ๐ง โ ๐น ๐ ๐ ๐ ๐ฆ
๐บ ๐บ ๐ ๐ ๐ ๐ ๐ ๐
๐ซ ๐ ๐ข ๐ ๐ ๐ ๐ฒ ๐ค ๐ค ๐พ ๐พ ๐พ โ ๐ ๐ ๐ฆ ๐ ๐น ๐ฟ ๐ฅ ๐ ๐บ ๐ ๐ ๐ ๐ฆ ๐ ๐ ๐ก
๐ข ๐ณ โฑ ๐ฝ ๐ ๐ฅ ๐ค ๐ง ๐ ๐ ๐ โ โ โ ๐ ๐น ๐น ๐ ๐ผ ๐ ๐ฝ ๐บ ๐ ๐ ๐ ๐ ๐ธ ๐ก ๐ฟ
๐ ๐ฒ โฐ ๐ฟ ๐ป ๐ค ๐จ ๐ณ ๐ช ๐คฐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐น ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ก ๐ง
๐ ๐ฑ ๐ฑ ๐ซ ๐ฅ ๐ค ๐ง ๐ญ ๐คก ๐งฃ ๐ ๐ ๐บ ๐บ ๐ ๐ ๐ โ โ ๐ ๐ฆ ๐ป ๐ง ๐ ๐ ๐ ๐ ๐ฎ ๐ง
๐ ๐จ ๐จ ๐ซ ๐ค ๐ง ๐ ๐ ๐ซ ๐ ๐บ ๐ฟ ๐ฟ ๐ฟ ๐ฟ ๐ฟ ๐ ๐ฅจ โฑ ๐ฟ ๐ ๐ฅ ๐ ๐ง ๐ ๐ ๐ฆ ๐ฎ ๐ฅ
๐ ๐ ๐ ๐ซ ๐ค ๐ง ๐ฏ ๐คก ๐ซ ๐งฃ ๐ ๐บ ๐ฟ ๐บ ๐บ ๐ฟ ๐บ ๐ ๐ฅจ ๐ ๐ ๐ ๐ ๐ง ๐ ๐ ๐ฆ ๐ ๐ฅ
๐ฃ ๐ฃ ๐ ๐ฒ ๐ ๐พ ๐ ๐คก ๐ซ ๐งฃ ๐บ ๐บ ๐บ ๐บ ๐บ ๐ฟ ๐ป ๐ป ๐ฟ ๐
๐ฟ ๐ฅ ๐ฌ ๐ ๐ ๐ ๐ ๐ ๐ก
๐ ๐ ๐ ๐ฒ ๐พ ๐ ๐ณ ๐คก ๐งฃ ๐บ ๐บ ๐บ ๐บ ๐บ ๐ฅซ โ โ ๐ ๐ ๐ ๐ง ๐ป ๐ป ๐ ๐ ๐ ๐ ๐ ๐ก
๐ ๐ ๐ ๐ป ๐ง ๐ ๐บ ๐ผ ๐ญ โฝ ๐บ ๐บ ๐ฅซ ๐ฅซ ๐ฅซ ๐ฟ ๐ฆ ๐ฏ ๐ฏ ๐ ๐ ๐ง ๐ป ๐ ๐ฆ ๐ ๐ ๐ ๐
๐ฑ ๐ฆ ๐ ๐พ ๐ง ๐ ๐ง ๐ ๐ฟ ๐ฟ ๐ ๐จ ๐บ ๐บ ๐บ ๐ฟ ๐ท ๐ ๐ท ๐ ๐ ๐ง ๐ป ๐ ๐ฆ ๐ ๐ธ ๐ ๐
๐ ๐ ๐ป ๐ง ๐ง ๐ ๐ ๐ ๐ฐ ๐ง ๐ ๐ ๐จ ๐บ ๐ป ๐ซ ๐ข ๐ณ ๐ ๐คก ๐คก ๐ง ๐ป ๐ ๐ฆ ๐ธ ๐ธ ๐ ๐ฎ
๐ง ๐ง ๐ฆ ๐ฃ ๐ ๐ด ๐
๐ ๐ด ๐ ๐ ๐ ๐ญ ๐บ ๐ป ๐ ๐ ๐ ๐ฆ ๐คก ๐ ๐ ๐ ๐ ๐ ๐ธ ๐ธ ๐ ๐
๐ง ๐ง ๐ ๐ฉ ๐ป ๐ฟ ๐คฐ ๐ ๐บ ๐ถ ๐ ๐ ๐ท ๐บ ๐บ ๐ฟ ๐ท ๐ฟ ๐ ๐ ๐ ๐ฅ ๐ ๐ ๐ ๐ธ ๐ ๐ ๐
๐ง ๐ฅ ๐ ๐ฉ ๐ ๐ฏ ๐คฐ ๐คฐ ๐คฐ ๐ ๐ ๐ ๐ท ๐ป ๐บ ๐บ ๐บ ๐ป ๐บ ๐บ ๐บ ๐ญ ๐ ๐ ๐ฐ ๐ธ ๐ ๐ฎ ๐
๐ฅ ๐ฅ ๐ ๐ฉ ๐ ๐ ๐ฃ ๐ฆ ๐ ๐ฆ ๐ต ๐ ๐ท ๐ป ๐บ ๐บ ๐ป ๐บ ๐บ ๐ฅซ ๐บ ๐ฐ ๐ ๐บ ๐ฐ ๐ธ ๐ ๐ฎ ๐
๐ฅ ๐ฅ ๐ฅ ๐ ๐ ๐ ๐ ๐จ ๐ป ๐ ๐ ๐ธ ๐บ ๐ป ๐บ ๐บ ๐ ๐ป ๐ฅซ ๐ฅซ ๐บ ๐ฐ ๐ ๐ฆ ๐ฐ ๐ธ ๐ ๐ฎ ๐
๐ฏ ๐ฅ ๐ฅ ๐ฅ ๐ฑ ๐ ๐ฆ ๐จ ๐ป โ ๐ ๐ ๐ ๐ป ๐บ ๐บ ๐บ ๐ป ๐บ ๐ฅซ ๐ฟ ๐ฐ ๐ ๐ฆ
๐ฐ ๐ธ ๐ฎ ๐ฎ ๐ฎ
๐ ๐ฏ ๐ฅ ๐ฅ ๐ ๐ฌ ๐ญ ๐ ๐ป ๐จ ๐ต ๐ ๐ ๐บ ๐บ ๐ฅซ ๐ฅซ ๐ฟ ๐บ ๐ฅซ ๐ฅซ ๐ ๐ฆ ๐ฐ ๐ฐ ๐ ๐ฎ ๐ฎ ๐
๐ ๐ ๐ฏ ๐ฅ ๐ ๐ฅ ๐ถ ๐ ๐ป ๐ ๐ญ ๐ต ๐ท ๐ ๐ ๐บ ๐บ ๐งฃ ๐ฟ ๐ฅซ ๐ฟ ๐ ๐ฆ ๐ฉ ๐ฐ ๐ ๐ฎ ๐ซ ๐
๐ณ ๐ด ๐น ๐ฅ
๐ ๐ฆ ๐ ๐ญ ๐ฆ ๐ค ๐น ๐ ๐ ๐ฎ ๐ฒ ๐ ๐ป ๐บ ๐ฅซ ๐ฅซ ๐ฐ ๐ฆ
๐ฆ
๐ ๐ฐ ๐ ๐ ๐ฎ ๐ฅ
๐ ๐น ๐ ๐ฅ
๐ฅ
๐ฅ
๐ป โ ๐ญ ๐ฆ ๐ญ ๐ ๐ ๐ ๐ป ๐บ ๐ ๐ฅซ ๐ฅซ ๐ ๐ ๐ฉ ๐ฉ ๐ ๐ก ๐ ๐ ๐ฎ ๐ง
๐ ๐ฅ
๐ฅ
๐ง ๐ฅ
๐ฅ
๐ง ๐ ๐ ๐ ๐ท ๐ฆ ๐จ ๐ป ๐บ ๐บ ๐ฅซ ๐ฅซ ๐ณ ๐ฟ ๐ ๐ ๐น ๐น ๐น ๐ฅ ๐ ๐ ๐ง
๐ฅ
๐ฅ
๐ฅ
๐ฅ
๐ ๐ฅ
๐ ๐ฉ โ ๐ ๐ถ ๐ฑ ๐จ ๐ป ๐บ ๐บ ๐ฅซ ๐ท ๐ฅ ๐ฅ ๐ ๐ ๐ ๐ฅ
๐ฅ
๐ ๐ ๐ ๐
๐ ๐ฅ
๐ฅ
๐ ๐ ๐ ๐ ๐จ ๐ฌ ๐ ๐ญ ๐ถ ๐ ๐บ ๐บ ๐ฟ ๐ท ๐ ๐ฅ ๐ฅ ๐ฏ ๐ โ ๐ฅ
๐ ๐ ๐ ๐ ๐ฟ
โ ๐ ๐ฅ
๐ ๐ ๐ โช ๐ฌ ๐ ๐ ๐ญ ๐ ๐คก ๐ท ๐ท ๐ณ ๐ ๐ง ๐ฐ ๐ฐ ๐ ๐ ๐ ๐ฅ
๐ ๐ ๐ โฉ ๐
โ ๐ ๐ ๐ ๐ ๐ ๐ฌ ๐ซ ๐ซ ๐ฌ ๐ฆ ๐บ ๐ฅซ ๐ฅซ ๐ฏ ๐ ๐ณ ๐ฆ ๐ฐ ๐ ๐ฒ ๐ ๐ ๐ฅ
๐ ๐ ๐ โ โ
โ ๐ ๐ ๐ ๐ โฉ ๐ ๐ฃ ๐ป ๐ด ๐ ๐ฆ ๐ ๐ฅซ ๐ ๐ฟ ๐ณ ๐จ ๐ณ ๐พ ๐ด ๐ ๐ ๐ฅ
๐ ๐ ๐ โ โ