Created
April 14, 2018 10:53
-
-
Save conanak99/0ff0d1ba5690dbc76385f75a6e4a07ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function addMustache(url, output) { | |
let source = await Jimp.read(url); | |
// Lấy chiều cao, rộng của ảnh | |
const { height, width } = source.bitmap; | |
const mustache = await Jimp.read('mustache.png'); | |
// Thu nhỏ bộ râu lại | |
mustache.resize(width, Jimp.AUTO); | |
return source.composite(mustache, 0, 0).write(output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment