Skip to content

Latest commit

History

History
26 lines (22 loc) 路 977 Bytes

File metadata and controls

26 lines (22 loc) 路 977 Bytes

EmojiPix

Working

  1. User uploads an image which gets loaded onto an HTML5 Canvas
  2. The image is then divided into blocks based on the selected block size
  3. Each block's average colour is calculated
  4. The emoji with the closest average colour is selected
  5. This loops until all blocks are processed
  6. The final image is displayed and can be downloaded or copied to clipboard

Adding more emoji sets

  • Create a new array of emojis and their average colour like this:
    const heartsOnly = [
      { emoji: '鉂わ笍', color: [220, 20, 60] },
      ...
    ];
    
  • Add an option for the new set in the HTML file
  • Modify the findNearestEmoji function to check for the new set

馃敆 Resources