chee / mojimosi

makes an emoji mosaic of your picture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mosimoji

make an emoji mosaic of from your picture

getty

  • npm i -g mojimosi

usage

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

๐ŸŽ ๐Ÿ—’ ๐Ÿ• ๐Ÿ•ณ โžฐ ๐ŸŒ  ๐Ÿฆ ๐Ÿ›ซ ๐Ÿ–ฒ ๐Ÿ—ป ๐Ÿ–‡ ๐Ÿ—ป ๐Ÿ‘พ ๐Ÿ”ง ๐Ÿ”ง ๐Ÿ›  ๐Ÿ‘“ ๐Ÿ—ป ๐Ÿ›ฉ ๐ŸงŸ ๐ŸŽฉ ๐Ÿฆ… ๐Ÿ“บ ๐Ÿ“บ ๐ŸŽ ๐Ÿ— ๐Ÿ— ๐Ÿ— ๐ŸŽ
๐ŸŽ ๐ŸŒซ ๐Ÿ—ฏ ๐Ÿ”ช ๐Ÿ‘Ÿ ๐Ÿ“ซ ๐Ÿ“ฒ ๐Ÿ—ป ๐Ÿฅ„ ๐Ÿฅ„ ๐Ÿ”ง ๐Ÿ”ง ๐Ÿ”ง ๐Ÿ”ง ๐Ÿ”ง โ› ๐Ÿ•น ๐Ÿ‡ ๐Ÿ€ ๐Ÿ•‹ ๐Ÿฆ… ๐Ÿ“บ ๐Ÿ“บ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐Ÿ— ๐ŸŸ
๐ŸŒซ ๐Ÿ“‘ ๐Ÿ“ข ๐Ÿ ๐ŸŽ‘ ๐Ÿ” ๐Ÿ–ฒ ๐Ÿ’ค ๐Ÿ’ค ๐Ÿ‘พ ๐Ÿ‘พ ๐Ÿ‘พ โ› ๐Ÿ‡ ๐Ÿ‡ ๐Ÿฆ† ๐Ÿ’„ ๐Ÿ•น ๐Ÿ“ฟ ๐Ÿ–ฅ ๐Ÿ„ ๐Ÿ“บ ๐ŸŽ ๐ŸŽ ๐Ÿ— ๐Ÿฆ‡ ๐ŸŸ ๐ŸŸ ๐Ÿ‘ก
๐Ÿ“ข ๐Ÿ•ณ โฑ ๐Ÿ‘ฝ ๐Ÿš‰ ๐Ÿฅ„ ๐Ÿ’ค ๐Ÿ”ง ๐Ÿœ ๐Ÿœ ๐Ÿƒ โ› โ› โ› ๐Ÿ‡ ๐Ÿ•น ๐Ÿ•น ๐Ÿ‘™ ๐Ÿ’ผ ๐Ÿƒ ๐Ÿ“ฝ ๐Ÿ“บ ๐ŸŽ ๐ŸŽ ๐Ÿ— ๐Ÿ ๐Ÿ“ธ ๐Ÿ‘ก ๐Ÿ“ฟ
๐Ÿ‘Ÿ ๐ŸŽฒ โžฐ ๐Ÿšฟ ๐Ÿ—ป ๐Ÿ’ค ๐Ÿ”จ ๐Ÿณ ๐ŸŽช ๐Ÿคฐ ๐Ÿ™… ๐Ÿš‚ ๐ŸŽ‰ ๐ŸŽ‰ ๐Ÿ‘ž ๐Ÿš˜ ๐Ÿš€ ๐Ÿš˜ ๐Ÿš˜ ๐Ÿ•น ๐Ÿƒ ๐ŸŒ˜ ๐Ÿ‘ ๐ŸŽ ๐Ÿ— ๐Ÿ ๐ŸŒ‹ ๐Ÿ‘ก ๐Ÿง›
๐Ÿš ๐Ÿ“ฑ ๐Ÿ’ฑ ๐Ÿ›ซ ๐Ÿฅ„ ๐Ÿ’ค ๐Ÿ”ง ๐Ÿญ ๐Ÿคก ๐Ÿงฃ ๐Ÿ” ๐Ÿ” ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ—‚ ๐Ÿ” ๐Ÿ‘  โ›‘ โ›‘ ๐Ÿ‘ž ๐Ÿฆ† ๐Ÿ’ป ๐ŸŽง ๐Ÿ„ ๐ŸŽ ๐Ÿ ๐ŸŒ‹ ๐Ÿฎ ๐Ÿง›
๐ŸšŸ ๐Ÿ—จ ๐Ÿ—จ ๐Ÿ›ซ ๐Ÿ’ค ๐Ÿ”ง ๐Ÿƒ ๐Ÿ– ๐Ÿซ ๐Ÿ” ๐Ÿ”บ ๐Ÿฟ ๐Ÿฟ ๐Ÿฟ ๐Ÿฟ ๐Ÿฟ ๐Ÿ—‚ ๐Ÿฅจ โ›ฑ ๐Ÿ“ฟ ๐Ÿœ ๐Ÿฅ„ ๐Ÿ–‡ ๐ŸŽง ๐ŸŽ ๐ŸŸ ๐Ÿฆ— ๐Ÿฎ ๐Ÿฅ€
๐Ÿ”š ๐ŸšŸ ๐Ÿš ๐Ÿ›ซ ๐Ÿ’ค ๐Ÿ”ง ๐ŸŽฏ ๐Ÿคก ๐Ÿซ ๐Ÿงฃ ๐Ÿ—‚ ๐Ÿ”บ ๐Ÿฟ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฟ ๐Ÿ”บ ๐Ÿ—‚ ๐Ÿฅจ ๐Ÿ’ ๐Ÿ‡ ๐Ÿ‘“ ๐Ÿ“Ž ๐ŸŽง ๐ŸŽ ๐ŸŸ ๐Ÿฆ— ๐Ÿ– ๐Ÿฅ€
๐Ÿ’ฃ ๐Ÿ’ฃ ๐Ÿš ๐Ÿ–ฒ ๐Ÿ“Ž ๐Ÿ‘พ ๐Ÿ“ ๐Ÿคก ๐Ÿซ ๐Ÿงฃ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฟ ๐Ÿป ๐Ÿป ๐Ÿฟ ๐ŸŒ… ๐Ÿ“ฟ ๐Ÿฅ„ ๐ŸŽฌ ๐Ÿ—ƒ ๐ŸŽ ๐ŸŸ ๐ŸŒ‹ ๐Ÿ– ๐Ÿ‘ก
๐Ÿ—ƒ ๐Ÿ—ƒ ๐Ÿ” ๐Ÿ–ฒ ๐Ÿ‘พ ๐Ÿƒ ๐Ÿ’ณ ๐Ÿคก ๐Ÿงฃ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ โ— โ— ๐ŸŽŠ ๐Ÿ› ๐Ÿ” ๐Ÿง› ๐Ÿ’ป ๐Ÿ’ป ๐Ÿ—ƒ ๐ŸŽ ๐ŸŸ ๐ŸŒ‹ ๐Ÿ– ๐Ÿ‘ก
๐Ÿ›’ ๐Ÿ›’ ๐Ÿš“ ๐Ÿ—ป ๐Ÿ”ง ๐Ÿœ ๐Ÿบ ๐Ÿ“ผ ๐ŸŽญ โ›ฝ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿฟ ๐Ÿฆƒ ๐ŸŽฏ ๐ŸŽฏ ๐Ÿ– ๐Ÿ˜ ๐Ÿ”ง ๐Ÿ’ป ๐Ÿ— ๐Ÿฆ‡ ๐Ÿ— ๐ŸŒ‹ ๐Ÿ– ๐ŸŒ
๐ŸŽฑ ๐Ÿฆ ๐Ÿ–‡ ๐Ÿ‘พ ๐Ÿ”ง ๐Ÿƒ ๐Ÿง› ๐Ÿœ ๐Ÿ“ฟ ๐Ÿ“ฟ ๐ŸŽ‰ ๐Ÿšจ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฟ ๐Ÿท ๐Ÿš ๐Ÿท ๐Ÿ” ๐Ÿ‰ ๐Ÿ”ง ๐Ÿ’ป ๐ŸŽ ๐Ÿฆ‡ ๐Ÿ— ๐Ÿ“ธ ๐Ÿ– ๐ŸŒ
๐ŸŒ˜ ๐Ÿ˜ ๐Ÿ—ป ๐Ÿ”ง ๐Ÿ”ง ๐Ÿƒ ๐Ÿš‚ ๐Ÿš‚ ๐Ÿฐ ๐ŸŽง ๐Ÿ‘ž ๐Ÿ’ ๐Ÿšจ ๐Ÿ”บ ๐Ÿป ๐Ÿซ ๐Ÿšข ๐Ÿ”ณ ๐Ÿœ ๐Ÿคก ๐Ÿคก ๐Ÿ”ง ๐Ÿ’ป ๐ŸŽ ๐Ÿฆ‡ ๐Ÿ“ธ ๐Ÿ“ธ ๐Ÿ  ๐Ÿฎ
๐ŸŽง ๐ŸŽง ๐Ÿฆ“ ๐Ÿ‘ฃ ๐Ÿ“Ž ๐Ÿšด ๐Ÿ™… ๐Ÿœ ๐ŸŽด ๐Ÿ”˜ ๐Ÿš‡ ๐Ÿš˜ ๐Ÿšญ ๐Ÿ”บ ๐Ÿป ๐Ÿ  ๐Ÿ‘  ๐Ÿ’ ๐Ÿฆƒ ๐Ÿคก ๐Ÿ—‚ ๐Ÿ›  ๐Ÿ—ƒ ๐Ÿ— ๐Ÿ ๐Ÿ“ธ ๐Ÿ“ธ ๐Ÿ– ๐Ÿ–
๐ŸŽง ๐ŸŽง ๐ŸŒ˜ ๐ŸŽฉ ๐Ÿ’ป ๐Ÿ“ฟ ๐Ÿคฐ ๐Ÿš‚ ๐Ÿ•บ ๐Ÿšถ ๐ŸŽ‰ ๐ŸŽ‰ ๐Ÿšท ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฟ ๐Ÿท ๐Ÿฟ ๐Ÿ” ๐Ÿ—‚ ๐Ÿ—‚ ๐Ÿ–ฅ ๐ŸŽ ๐Ÿ— ๐Ÿ ๐Ÿ“ธ ๐Ÿ  ๐Ÿ– ๐Ÿ–
๐ŸŽง ๐Ÿ–ฅ ๐ŸŒ˜ ๐ŸŽฉ ๐ŸšŸ ๐ŸŽฏ ๐Ÿคฐ ๐Ÿคฐ ๐Ÿคฐ ๐Ÿ‘  ๐Ÿ’ ๐Ÿ’ ๐Ÿšท ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿญ ๐ŸŽ ๐ŸŽ ๐Ÿฐ ๐Ÿ“ธ ๐Ÿ  ๐Ÿฎ ๐Ÿ–
๐Ÿ–ฅ ๐Ÿ–ฅ ๐ŸŒ˜ ๐ŸŽฉ ๐Ÿ” ๐ŸŽŽ ๐Ÿฃ ๐Ÿฆ ๐Ÿ“› ๐Ÿฆ ๐Ÿ“ต ๐Ÿš’ ๐Ÿšท ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿ”บ ๐Ÿ•ฐ ๐ŸŽ ๐Ÿ“บ ๐Ÿฐ ๐Ÿ“ธ ๐Ÿ  ๐Ÿฎ ๐Ÿ–
๐Ÿ–ฅ ๐Ÿ–ฅ ๐Ÿ–ฅ ๐ŸŒ˜ ๐Ÿ”˜ ๐Ÿ› ๐Ÿ“ ๐Ÿšจ ๐Ÿ”ป ๐Ÿ“› ๐Ÿš’ ๐ŸŽธ ๐Ÿ‘บ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ’ ๐Ÿ”ป ๐Ÿฅซ ๐Ÿฅซ ๐Ÿ”บ ๐Ÿ•ฐ ๐ŸŽ ๐Ÿฆ‡ ๐Ÿฐ ๐Ÿ“ธ ๐Ÿ– ๐Ÿฎ ๐Ÿ–
๐Ÿฏ ๐Ÿ–ฅ ๐Ÿ–ฅ ๐Ÿ–ฅ ๐Ÿ’ฑ ๐ŸŽŽ ๐Ÿฆ‘ ๐Ÿšจ ๐Ÿ”ป โ›” ๐Ÿ“ ๐Ÿš’ ๐Ÿ“ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฟ ๐Ÿ•ฐ ๐Ÿ‘ ๐Ÿฆ… ๐Ÿฐ ๐Ÿ“ธ ๐Ÿฎ ๐Ÿฎ ๐Ÿฎ
๐Ÿ€ ๐Ÿฏ ๐Ÿ–ฅ ๐Ÿ–ฅ ๐ŸŽ› ๐Ÿšฌ ๐Ÿšญ ๐Ÿ„ ๐Ÿ”ป ๐Ÿšจ ๐Ÿ“ต ๐Ÿš’ ๐Ÿ‘  ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿฟ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿš ๐Ÿฆ‡ ๐Ÿฐ ๐Ÿฐ ๐Ÿ  ๐Ÿฎ ๐Ÿฎ ๐ŸŒ
๐Ÿš‡ ๐Ÿ€ ๐Ÿฏ ๐Ÿ–ฅ ๐ŸŽ‘ ๐ŸŽฅ ๐Ÿšถ ๐Ÿ„ ๐Ÿ”ป ๐Ÿ„ ๐Ÿšญ ๐Ÿ“ต ๐Ÿšท ๐Ÿ’ ๐Ÿ“› ๐Ÿ”บ ๐Ÿ”บ ๐Ÿงฃ ๐Ÿฟ ๐Ÿฅซ ๐Ÿฟ ๐Ÿ‘ ๐Ÿฆ‡ ๐ŸŽฉ ๐Ÿฐ ๐Ÿ  ๐Ÿฎ ๐Ÿซ ๐ŸŒ
๐Ÿณ ๐Ÿšด ๐Ÿ•น ๐Ÿฅ… ๐Ÿ’„ ๐Ÿฆ† ๐Ÿ‘™ ๐Ÿšญ ๐Ÿฆ ๐Ÿค ๐Ÿ‘น ๐Ÿ‘„ ๐Ÿ“• ๐Ÿ“ฎ ๐Ÿˆฒ ๐Ÿ’ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿ•ฐ ๐Ÿฆ… ๐Ÿฆ… ๐ŸŒ˜ ๐Ÿฐ ๐Ÿ– ๐ŸŒ ๐Ÿฎ ๐Ÿฅ€
๐Ÿœ ๐Ÿ•น ๐Ÿ’„ ๐Ÿฅ… ๐Ÿฅ… ๐Ÿฅ… ๐Ÿ’ป โ›‘ ๐Ÿšญ ๐Ÿฆ ๐Ÿšญ ๐Ÿ“ ๐Ÿ“ ๐Ÿ’ ๐Ÿ”ป ๐Ÿ”บ ๐ŸŒ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿ  ๐Ÿ’„ ๐ŸŽฉ ๐ŸŽฉ ๐ŸŒ˜ ๐Ÿ‘ก ๐Ÿ˜ ๐ŸŒ ๐Ÿฎ ๐Ÿง›
๐Ÿ’„ ๐Ÿฅ… ๐Ÿฅ… ๐Ÿ”ง ๐Ÿฅ… ๐Ÿฅ… ๐ŸŽง ๐Ÿ–‡ ๐Ÿš˜ ๐Ÿ’ ๐Ÿšท ๐Ÿฆ ๐Ÿšจ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿ’ณ ๐Ÿ“ฟ ๐ŸŽ ๐ŸŽ ๐Ÿ•น ๐Ÿ•น ๐Ÿ•น ๐Ÿฅ€ ๐ŸŒ ๐ŸŒ ๐Ÿง›
๐Ÿฅ… ๐Ÿฅ… ๐Ÿฅ… ๐Ÿฅ… ๐ŸŽ ๐Ÿฅ… ๐ŸŒ‰ ๐Ÿ›ฉ โ› ๐Ÿš˜ ๐Ÿšถ ๐Ÿšฑ ๐Ÿšจ ๐Ÿ”ป ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฅซ ๐Ÿท ๐Ÿ–ฅ ๐Ÿ–ฅ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐Ÿฅ… ๐Ÿฅ… ๐ŸŽ ๐Ÿ‘ž ๐ŸŒ ๐Ÿ‘ž
๐ŸŽ ๐Ÿฅ… ๐Ÿฅ… ๐ŸŽ ๐Ÿ’‹ ๐ŸŽ ๐Ÿ ๐Ÿ—จ ๐ŸŽฌ ๐Ÿœ ๐ŸŽญ ๐Ÿšถ ๐Ÿ„ ๐Ÿ”บ ๐Ÿ”บ ๐Ÿฟ ๐Ÿท ๐Ÿ˜ ๐Ÿ–ฅ ๐Ÿ–ฅ ๐ŸŽฏ ๐ŸŽ โŒ ๐Ÿฅ… ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐Ÿ‘ž ๐Ÿ“ฟ
โŒ ๐ŸŽ ๐Ÿฅ… ๐Ÿ’‹ ๐Ÿ’‹ ๐ŸŽ โ›ช ๐Ÿ“ฌ ๐ŸŽ‘ ๐Ÿ›’ ๐Ÿญ ๐Ÿ“ ๐Ÿคก ๐Ÿท ๐Ÿท ๐Ÿ’ณ ๐ŸŒ˜ ๐Ÿง› ๐Ÿฐ ๐Ÿฐ ๐ŸŒ„ ๐ŸŽ ๐ŸŽ ๐Ÿฅ… ๐ŸŽ ๐ŸŽ ๐ŸŽ โ›ฉ ๐Ÿ‘™
โŒ ๐ŸŽ ๐ŸŽ ๐Ÿ’‹ ๐Ÿ’‹ ๐ŸŽ ๐Ÿฌ ๐Ÿ›ซ ๐Ÿ›ซ ๐ŸŒฌ ๐Ÿฆ‰ ๐Ÿบ ๐Ÿฅซ ๐Ÿฅซ ๐Ÿ•ฏ ๐Ÿ‘ž ๐ŸŽณ ๐Ÿฆ‡ ๐Ÿฐ ๐Ÿ–‡ ๐Ÿ–ฒ ๐Ÿ‘™ ๐ŸŽ ๐Ÿฅ… ๐ŸŽ ๐ŸŽ ๐ŸŽ โŒ โŒ
โŒ ๐ŸŽ ๐Ÿ’‹ ๐Ÿ’‹ ๐Ÿ’‹ โ›ฉ ๐Ÿ“ž ๐ŸŽฃ ๐Ÿ—ป ๐Ÿ›ด ๐Ÿ ๐Ÿฆ” ๐Ÿ€„ ๐Ÿฅซ ๐Ÿ› ๐Ÿ“ฟ ๐Ÿ›ณ ๐Ÿจ ๐ŸŽณ ๐Ÿ‘พ ๐Ÿ›ด ๐ŸŽ ๐ŸŽ ๐Ÿฅ… ๐ŸŽ ๐ŸŽ ๐ŸŽ โŒ โŒ

About

makes an emoji mosaic of your picture

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%