Giter Club home page Giter Club logo

gifmeme's Introduction

GifMeme NPM Version

Node.js module for creating a meme from an animated gif will work with static images too such as jpeg and png.

To Install

    $ npm install gifmeme

Requirements

Nodejs 6.4.0+ (utilizes es6 promises.)

GifMeme is utilizing ImageMagick to finalize the output of the animated gif. Please insure that ImageMagick is installed locally.

API

  • init on require - eg require ('gifmeme')(outputDirectoryName, fileAppendedName)

    outputDirectoryName (optional, default is './tmp') is where the meme file will be written to on your file system.

    fileAppendedName (optional, default is '-meme') is a string that will be appended to the original file name. eg - if fileAppendedName = '-meme', photo.png will write out to photo-meme.png

  • generate(file, topText, bottomText)

    file is the filename and location - eg. __dirname + 'public/images/photo.png'

    topText and bottomText are the text that will be overlayed on the top and bottom of the photo respectively.

    this function will return a promise with the filename of the generated meme. If an error occurs the promise will throw a rejection with the error.

Example Code

var gifmeme = require('gifmeme')();
try{
    gifmeme.generate('./test.gif', 'Top of Meme', 'Bottom of Meme').then(memeFilename => {
        console.log('Meme Generated to :' + memeFilename);
    });
} catch(e){
    console.log(e);
}

#Test Example

You can simply run the test.js file included with this repository

> node test.js

gifmeme's People

Contributors

obj63mc avatar

Watchers

 avatar  avatar

Forkers

koty11

gifmeme's Issues

top of text not properly aligned - SUGGESTION

The top of text kept being half in the image and half out, so i added
+topFontSize.fontSize to the second argument and that seemed to fix it FYI

.drawText(0, 15+topFontSize.fontSize, topText, "North")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.