Create cover and profile pictures with face centered and uniform expected sizes.
It gets an input image and outputs two images: a cover image centered with specified size, and a profile picture with square ratio centered in bigest detected human face.
npm install profile-pic
var profilePic = ;var images =/* Landscape Ratio */width: 400height: 240filename: '/tmp/landscape.jpg'/* Portrait Ratio */width: 240height: 400filename: '/tmp/standing.jpg'/* detected face avatar with square ratio */avatar: truewidth: 128height: 128filename: '/tmp/profile.jpg';;
This example will result in 3 images out of this input:
- Two centered and resized to expected size:
- And one avatar image with biggest detected face: