gifpet
v1.0.3-dev
Published
> You can get it from NPM [@gifpet](https://www.npmjs.com/package/gifpet).
Downloads
7
Maintainers
Readme
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
Further meme info
Demo
→
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 :)