Skip to content

JavaScript API wrapper for the FaceApp tool for Android and iOS

License

Notifications You must be signed in to change notification settings

hama/faceapp.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FaceApp

NPM version NPM downloads Build status Dependencies

JavaScript API wrapper for the FaceApp tool for Android and iOS. Licensed under ISC License.

NOTE: Node.js 8 or higher is REQUIRED

Installation

Using NPM: npm install faceapp
Using Yarn: yarn add faceapp

Usage

First, import the module

const faceapp = require('faceapp')

The function takes two parameters:

  • path: string | file: Buffer - Path to the image file you would like to process. Or a Buffer object representing an image.
  • filterID: string - FaceApp Filter ID

Example

// Import the module
const faceapp = require('faceapp')

// Process the image (filepath)
let image = await faceapp.process('path/to/image.png', 'smile_2')

// Process the image (buffer)
// First we have to get a buffer
let res = await superagent.get('http://example.com/image.png')
let image = await faceapp.process(res.body, 'hot')

Filter IDs

There are some known Filter IDs:

  • no-filter
  • smile
  • smile_2
  • hot
  • old
  • young
  • female_2
  • female
  • male
  • pan
  • hitman

However, you can get an up-to-date list of all available filter IDs from the API directly using the listFilters function.

let filters = await faceapp.listFilters()
// Returns an array of Filter objects

let filters = await faceapp.listFilters(true)
// Returns an array filter ID strings

Thanks

About

JavaScript API wrapper for the FaceApp tool for Android and iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%