1.0.0 • Published 3 years ago

toonify v1.0.0

Weekly downloads
16
License
ISC
Repository
github
Last release
3 years ago

Toonify!

image

Transform your images applying an cartoon style using AI.

It is based on the DeepAi Toonify api rest.

You need to get a totally free apiKey from the DeepAi page.

Installation

npm i --save toonify

Example

Transform an image from an external url

const toonify = require('toonify');
const cartoon = new toonify('YOUR_API_KEY_HERE');

cartoon.transform({
    photo: 'https://media.gq.com.mx/photos/5e220ec2ffa8c7000803441e/16:9/w_1920,c_limit/40-datos-curiosos-para-descubrir-a-scarlett-johansson.jpg',
    // To save the image to a specific path
    destinyFolder: './images'
})
.then(data => {
    console.log('Image', data);
})
.catch(err => {
    console.log('Error', err);
})

Transform a local image and get image in base64

const toonify = require('toonify');
const cartoon = new toonify('YOUR_API_KEY_HERE');
const path = require('path');

cartoon.transform({
    photo: path.join(__dirname, './image.jpg')
})
.then(data => {
    console.log('Image in base64', data);
})
.catch(err => {
    console.log('Error', err);
})

Related

You can find a job where this module is used directly on whatsapp here: WABOT