Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emoji paint #28

Open
forresto opened this issue Jul 2, 2014 · 5 comments
Open

emoji paint #28

forresto opened this issue Jul 2, 2014 · 5 comments

Comments

@forresto
Copy link
Member

forresto commented Jul 2, 2014

🌚🌘🌗🌖🌝🌔🌓🌒🌚

🌞🌞🌞🌞🌞🌞🌞🌞🌞🌞
🌞🌚🌚🌚🌚🌚🌚🌚🌚🌚
🌞🌚🌞🌞🌞🌞🌞🌞🌞🌚
🌞🌚🌞🌚🌚🌚🌚🌚🌞🌚
🌞🌚🌞🌚🌞🌞🌞🌚🌞🌚
🌞🌚🌞🌚🌚🌚🌞🌚🌞🌚
🌞🌚🌞🌞🌞🌞🌞🌚🌞🌚
🌞🌚🌚🌚🌚🌚🌚🌚🌞🌚
🌞🌞🌞🌞🌞🌞🌞🌞🌞🌚
🌚🌚🌚🌚🌚🌚🌚🌚🌚🌚

At the risk of taking the emoji thing too far...

How hard would it be to analyze the pixels in a set of emoji and make some kind of data structure that we could search to find a closest match? Then we could make a graph that

  1. chooses a random 36x36 square of a source image
  2. finds the closest emoji
  3. draws that character to that position in the destination canvas
  4. repeat as long as you like

I'd be interested to see how it would look, choosing different palettes of emoji, etc.

@forresto
Copy link
Member Author

forresto commented Jul 2, 2014

So, this works in Firefox at least. The only question is how to do the pixel classification / search in # 2.

moons

context.font = "50px verdana";
chars = ["🌚","🌘","🌗","🌖","🌝","🌔","🌓","🌒"];
for (var i=0; i<1000; i++) {
  context.fillText(chars[Math.floor(Math.random()*chars.length)], Math.random()*500, Math.random()*500);
}

@forresto
Copy link
Member Author

forresto commented Jul 2, 2014

emojiStringToArray = (str) ->
  split = str.split(/([\uD800-\uDBFF][\uDC00-\uDFFF])/);
  arr = []
  for char in split
    unless char is ""
      arr.push char
  return arr

Needed because "😴😄😃⛔🎠🚓🚇".length == 13 because ⛔ length is one, the rest are two. Woof 🐶

@forresto
Copy link
Member Author

forresto commented Jul 3, 2014

Tangential: art typing doesn't have to stick to a grid either:
art typing

@forresto
Copy link
Member Author

forresto commented Jul 3, 2014

This made me laugh
emoji-mandala

@automata
Copy link
Member

automata commented Jul 4, 2014

😍

To use JSFeat to extract (and cache) features from each emoji and compare that with a random square from original image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants