Profile Picture
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.
Install
npm install profile-pic
Usage
var profilePic = ;var images = /* Landscape Ratio */ width: 400 height: 240 filename: '/tmp/landscape.jpg' /* Portrait Ratio */ width: 240 height: 400 filename: '/tmp/standing.jpg' /* detected face avatar with square ratio */ avatar: true width: 128 height: 128 filename: '/tmp/profile.jpg' ; ;
This example will result in 3 images out of this input:
INPUT:
OUTPUT:
- Two centered and resized to expected size:
landscape.jpg (400x240)
standing.jpg (400x240)
- And one avatar image with biggest detected face:
profile.jpg (128x128)