Replace faces in an image with Tom wiggle or your own Gif!
- Imagemagick
- OpenCV v2.4.x
Replace faces in image(s) with Tom wiggle or your own Gif!
Usage: $ tomify <image>
Options:
--output, -o Output Path, default: $PWD
--resize, -r Resize Tom, default: 1 (Number)
--debug, -d Debug Mode, default: false
--gif, -g Gif Path, default: tom-wiggle.gif
--help, -h Display Help
--version Display Version
Examples:
$ tomify image.jpg
# process single image and save to $PWD/image.gif
$ tomify person1.jpg person2.jpg --output ./new-folder
# process multiple images, and saves to ./new-folder
const gif = 'path/to/custom.gif'
const file = 'image/with/faces.jpg'
const dest = 'path/to/output.gif'
const resize = 1
replaceAll({ file, dest, resize, gif })
.then(() => {
console.log('Done!')
})
.catch(err => {
console.error('Uh oh!')
console.error(err)
})
// Find and replace all Faces with gif
async function replaceAll({ file, dest, resize })
// Params
Object
file = Filepath
dest = Filepath
resize = Integer
// Adds a Gif to all all positions
async function addGifs({ dest, file, positions })
// Params
Object
dest = Filepath
file = Filepath
positions = Array of Objects
Object - {file, x, y, height, width, gif} // see createQuery for details
// Creates an imagemagick query, used internally in addGifs
function createQuery({ file, x, y, height, width, gif })
// Params
Object
file = Filepath
x = Integer
y = Integer
height = Integer
width = Integer
gif = Filepath
// Returns Formatted Array
// Async Detect - returns Promise
function detect(file)
// Params
file = Filepath
// Returns
Object
faces = Array of Face (See faced)
image = Matrix
file = Filepath
// Enables logging if environment variable TOMIFY_DEBUG is 'true'
// note: this is just a small wrapper to console.error
function debug(msg, ...args)
// Params
msg = String
...args
- Running macOS 10.12 (Sierra)? See: https://github.com/Homebrew/homebrew-science/issues/4303