Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Last active November 5, 2021 22:10
Show Gist options
  • Save polluterofminds/4e1e8eeb6f5af5a00c124f4846872ee0 to your computer and use it in GitHub Desktop.
Save polluterofminds/4e1e8eeb6f5af5a00c124f4846872ee0 to your computer and use it in GitHub Desktop.
PFP Generator
const editly = require('editly');
const randomHex = require('random-hex');
const short = require('short-uuid');
const pathToFile = 'PATH TO FILE IN YOUR WORKING DIRECTORY';
const totalSupply = 5000;
const run = async () => {
for(i = 0; i < totalSupply; i++) {
console.log("generating image: ", i);
const options = {
outPath: `${short.generate()}.gif`,
path: pathToFile,
defaults: {
transition: { name: 'linearblur', duration: 0.1 },
},
clips: [
{ duration: 0.25, layers: [{ type: 'image', path: pathToFile }] },
{ duration: 0.25, layers: [{ type: 'linear-gradient', colors: [randomHex.generate(), randomHex.generate()] }] },
{ duration: 0.25, layers: [{ type: 'radial-gradient', colors: [randomHex.generate(), randomHex.generate()] }] },
{ duration: 0.25, layers: [{ type: 'linear-gradient' }] },
{ duration: 0.25, layers: [{ type: 'radial-gradient' }] },
],
}
await editly(options)
}
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment