In this article, we will discuss how to generate animated crypto PFPs.
Generating PFPs is done via a combination of base layers such as the background, body, face, attire, accessories, etc. However, developing the final images needs to be automated because PFP NFTs are released as a collection, often exceeding 10,000 in number. That's where the PFP art generators come into the picture.
Examples of Layers:

Read on to discover how the HashLips art engine can be updated to generate a collection of animated PFPs, which can then be minted into NFTs.
Problem/Goal
In order to create PFPs with animated backgrounds, there are different solutions. Among the solutions, the HashLips art engine (https://github.com/HashLips/hashlips_art_engine) is one of the most popular, freely available PFP art generators available online. This generator combines multiple image files, often PNGs, to generate PFP collections.
However, the HashLips art engine doesn't support animated backgrounds. Moreover, there are no other readily available solutions.
Solution
Most of the features of the HashLips art engine are useful. So, the ideal solution is to update the engine to support animated backgrounds. To achieve that, we can leverage the brilliant 'sharp' library https://sharp.pixelplumbing.com/.
This is how we are able to create gifs with sharp:
await sharp(baseLayerPath, {
animated: true,
})
.composite(otherLayers)
.toFile(`${buildDir}/images/${sha1(newDna)}.gif`);
We also have to edit `src/main.js` in other places, but the most important part is replacing the canvas library with sharp.
Results
The updated code makes it possible to generate 1000s of images using the animations and the other base layers already possessed. In addition, these animated GIF images make it possible to create an animated NFT collection.
Conclusion
Creating these images and minting them into NFTs is a growing trend among artists, creators, collectors, and businesses. We at Red Crackle can help you create your collection of PFPs or any range of custom IT solutions for your needs. To get started, you may email us your requirements at info@redcrackle.com.