ezgif-node
v2.0.2
Published
An unofficial api for ezgif.com
Readme
About The Package
This is an unoffical api for this website. It can make(render), convert file types and edit images(gif,apng,etc) and videos.
If you want to know more about it or need help using it, you can join my discord server here and ask there.
New v2.0.0
- Added optimization for gif,png,jpg,webp and videos
- Added img overlay
- Added text overlay
- Added remove background
Optimization
await ezgif.optimize({
type: 'png',
file: await fs.readFileSync('img/pic.png'),
filename: 'img.png',
//params specific to each method(check src for reference)
})Img Overlay
await ezgif.overlay({
file: await fs.readFileSync('img/s.gif'),
filename: 's.gif',
overlay: {
file: await fs.readFileSync('img/pic.png'),
filename: 'over.png'
},
x: 0,
y: 0,
o_width: 200,
o_height: 200
})Txt Overlay
await ezgif.textOverlay({
file: await fs.readFileSync('img/pic.png'),
filename: 'pic.png',
text: 'Hello World',
size: 50,
})Remove Background
await ezgif.effects.remove_bg({
"url": 'https://media.lordicon.com/icons/wired/flat/298-coins.gif',
"tr_white": "on",
"nostack": "on"
})Render
Readering a gif/apng/webp/avif:
const ezgif = require('./index.js')
const fs = require('fs')
let url = await ezgif.render({
type: 'gif',//anyone of the type gif/apng/webp/avif
files: [
{
data: await fs.readFileSync('1.png'), //file buffer
name: '1.png',//file name with extention
delay: 100
},
{
data: await fs.readFileSync('2.png'),
name: '2.png',
},
{
data: await fs.readFileSync('3.png'),
name: '3.png',
}
//you can add more files upto 2000.
],
// delay: 150,//in ms, optional
// nostack: 'on',//optional
// dfrom: 1, //optional
// dto: 5, //optional
// 'fader-delay':6, //optional
// 'fader-frames':10, //optional
// loop: 0, //optional
// fader: 'on', //optional
// 'keep-first': 'on', //optional
// global_colormap: 'on', //optional (gif only)
// percentage: 90, //optional (webp only)
// skipfirst: 'on', //optional (apng only)
})
console.log(url)// returns a urlConvert
Convert the file types.
const ezgif = require('./index.js')
const fs = require('fs')
let url = await ezgif.convert({
type: 'gif-png', // see below for all the types, or run "ezgif.convert('list')"
url: 'https://i.imgur.com/jopn0xJ.gif',
// file: await fs.readFileSync('img.gif'),
// filename: 'upload.gif',
})
console.log(url)// returns a urlSupport
Join my discord server if you need anymore help. :)
Conversion Types
1. "video-gif"
2. "gif-mp4"
3. "video-jpg"
4. "video-png"
5. "gif-png"
6. "gif-sprite"
7. "sprite-imgage"
8. "sprite-img"
9. "bmp-jpg"
10. "bmp-png"
11. "bmp-gif"
12. "png-jpg"
13. "png-gif"
14. "png-bmp"
15. "gif-jpg"
16. "svg-png"
17. "svg-jpg"
18. "apng-gif"
19. "apng-webp"
20. "apng-mp4"
21. "mng-apng"
22. "video-apng"
23. "gif-apng"
24. "video-webp"
25. "gif-webp"
26. "jpg-webp"
27. "png-webp"
28. "webp-gif"
29. "webp-jpg"
30. "webp-png"
31. "webp-mp4"
32. "video-avif"
33. "gif-avif"
34. "apng-avif"
35. "webp-avif"
36. "jpg-avif"
37. "avif-gif"
38. "avif-jpg"
39. "avif-png"