mimic.js
// Draw the dominant emoji on the image
Draw the dominant emoji on the image
Draw the dominant emoji on the image
function drawEmoji(canvas, img, face) {
  var ctx = canvas.getContext('2d');
  ctx.font = '48px serif';
  var emogiX = face.featurePoints[4].x;
  var emogiY = face.featurePoints[4].y;
  var emogi = face.emojis.dominantEmoji;
  ctx.fillText(emogi, emogiX, emogiY);
}
function drawEmoji ( canvas , img , face ) { var ctx = canvas . getContext ( '2d' ) ; ctx . font = '48px serif' ; var emogiX = face . featurePoints [ 4 ] . x ; var emogiY = face . featurePoints [ 4 ] . y ; var emogi = face . emojis . dominantEmoji ; ctx . fillText ( emogi , emogiX , emogiY ) ; }
Draw the dominant emoji on the image
Draw the dominant emoji on the image
// Obtain a 2D context object to draw on the canvas // Set the font and style you want for the emoji // Draw it using ctx.strokeText() or fillText() // See: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText // Pick a particular feature point as an anchor so that the emoji sticks to your face // void ctx.fillText(text, x, y [, maxWidth]);