mojimosi v3.0.1
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
š š š š³ ā° š š¦ š« š² š» š š» š¾ š§ š§ š š š» š© š§ š© š¦
šŗ šŗ š š š š š
š š« šÆ šŖ š š« š² š» š„ š„ š§ š§ š§ š§ š§ ā š¹ š š š š¦
šŗ šŗ š š š š š š
š« š š¢ š š š š² š¤ š¤ š¾ š¾ š¾ ā š š š¦ š š¹ šæ š„ š šŗ š š š š¦ š š š”
š¢ š³ ā± š½ š š„ š¤ š§ š š š ā ā ā š š¹ š¹ š š¼ š š½ šŗ š š š š šø š” šæ
š š² ā° šæ š» š¤ šØ š³ šŖ š¤° š
š š š š š š š š š¹ š š š š š š š š” š§
š š± š± š« š„ š¤ š§ š š¤” š§£ š š šŗ šŗ š š š ā ā š š¦ š» š§ š š š š š® š§
š šØ šØ š« š¤ š§ š š š« š šŗ šæ šæ šæ šæ šæ š š„Ø ā± šæ š š„ š š§ š š š¦ š® š„
š š š š« š¤ š§ šÆ š¤” š« š§£ š šŗ šæ šŗ šŗ šæ šŗ š š„Ø š š š š š§ š š š¦ š š„
š£ š£ š š² š š¾ š š¤” š« š§£ šŗ šŗ šŗ šŗ šŗ šæ š» š» šæ š
šæ š„ š¬ š š š š š š”
š š š š² š¾ š š³ š¤” š§£ šŗ šŗ šŗ šŗ šŗ š„« ā ā š š š š§ š» š» š š š š š š”
š š š š» š§ š šŗ š¼ š ā½ šŗ šŗ š„« š„« š„« šæ š¦ šÆ šÆ š š š§ š» š š¦ š š š š
š± š¦ š š¾ š§ š š§ š šæ šæ š šØ šŗ šŗ šŗ šæ š· š š· š š š§ š» š š¦ š šø š š
š š š» š§ š§ š š š š° š§ š š šØ šŗ š» š« š¢ š³ š š¤” š¤” š§ š» š š¦ šø šø š š®
š§ š§ š¦ š£ š š“ š
š š“ š š š š šŗ š» š š š š¦ š¤” š š š š š šø šø š š
š§ š§ š š© š» šæ š¤° š šŗ š¶ š š š· šŗ šŗ šæ š· šæ š š š š„ š š š šø š š š
š§ š„ š š© š šÆ š¤° š¤° š¤° š š š š· š» šŗ šŗ šŗ š» šŗ šŗ šŗ š š š š° šø š š® š
š„ š„ š š© š š š£ š¦ š š¦ šµ š š· š» šŗ šŗ š» šŗ šŗ š„« šŗ š° š šŗ š° šø š š® š
š„ š„ š„ š š š š šØ š» š š šø šŗ š» šŗ šŗ š š» š„« š„« šŗ š° š š¦ š° šø š š® š
šÆ š„ š„ š„ š± š š¦ šØ š» ā š š š š» šŗ šŗ šŗ š» šŗ š„« šæ š° š š¦
š° šø š® š® š®
š šÆ š„ š„ š š¬ š š š» šØ šµ š š šŗ šŗ š„« š„« šæ šŗ š„« š„« š š¦ š° š° š š® š® š
š š šÆ š„ š š„ š¶ š š» š š šµ š· š š šŗ šŗ š§£ šæ š„« šæ š š¦ š© š° š š® š« š
š³ š“ š¹ š„
š š¦ š š š¦ š¤ š¹ š š š® š² š š» šŗ š„« š„« š° š¦
š¦
š š° š š š® š„
š š¹ š š„
š„
š„
š» ā š š¦ š š š š š» šŗ š š„« š„« š š š© š© š š” š š š® š§
š š„
š„
š§ š„
š„
š§ š š š š· š¦ šØ š» šŗ šŗ š„« š„« š³ šæ š š š¹ š¹ š¹ š„ š š š§
š„
š„
š„
š„
š š„
š š© ā š š¶ š± šØ š» šŗ šŗ š„« š· š„ š„ š š š š„
š„
š š š š
š š„
š„
š š š š šØ š¬ š š š¶ š šŗ šŗ šæ š· š š„ š„ šÆ š ā š„
š š š š šæ
ā š š„
š š š āŖ š¬ š š š š š¤” š· š· š³ š š§ š° š° š š š š„
š š š ā© š
ā š š š š š š¬ š« š« š¬ š¦ šŗ š„« š„« šÆ š š³ š¦ š° š š² š š š„
š š š ā ā
ā š š š š ā© š š£ š» š“ š š¦ š š„« š šæ š³ šØ š³ š¾ š“ š š š„
š š š ā ā