1.0.3-dev • Published 1 year ago

gifpet v1.0.3-dev

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

GIFPET

You can get it from NPM @gifpet.

Given a square avatar, generate a petting gif (known as "petpet" or "pet the").

The avatar will bounce up and down to simulate the petting.

Inspired by benisland

@benisland

Further meme info

@Info

Demo

InputOutput

Installation & Use

npm i -S gifpet

const Instance = require('gifpet');
const { Canvas } = new Instance();

💡 You can simply not add any parameters and leave all this empty, it's just in case you want to modify or add more things.

let params = {
    resolution: 128, // The width (or height) of the generated gif
    delay: 20, // Delay between each frame in milliseconds. Defaults to 20.
    backgroundColor: "red", // Other values could be the string "rgba(123, 233, 0, 0.5)". Defaults to null - i.e. transparent.
}

let image = 'https://vangh.org/schema/image/image.png'

It also works by simply using a buffer, instead of a url.

let animated = await Canvas.create(image, params)

You can do it without parameters too: await Canvas.create(image)

return console.log(animated)

Enjoying life :)

1.0.3-dev

1 year ago

1.0.2-dev

1 year ago

1.0.1-dev

1 year ago

1.0.0-dev

1 year ago