Skip to content

qwelias/face-crop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

face-crop

Description

Detects face in an image and crops it.

Installation

npm i face-crop

Options

  • src : String - source image absolute path
  • dst : Object
    • path : String - destination image absolute path
    • width? : Number - destination image width ( equals height if not present )
    • height? : Number - destination image height ( equals width if not present )
  • scale? : Number - size multiplier of the found face ( default: 1 )
  • force? : Boolean - crop and resize whole image even if no faces found ( default: false )

Exceptions

Promise will be rejected in case of lack of required options or if no faces found.

Usage

const FC = require('face-crop');
const Path = require('path');

FC({
    src: Path.resolve("./imgs/1.png"),
    dst: {
        path: Path.resolve("./out/1.png"),
        width: 200,
        height: 200
    },
    scale: 3
}).then(path => {
    //foo
}).catch(e => {
    //bar
});

About

crops face from imgs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published