A behind-the-scenes look at generating 1,000+ digital collectibles.
11 April 2022
Profile picture NFTs – or PFP NFTs for short – are small pieces of digital art that work well as avatars for people to use on their social media accounts.
Many PFP projects programatically generate collections containing tens, hundreds or even thousands of different items. Individual NFTs in a collection can be bought and sold, with blockchain technology used to guarantee the uniqueness of each item and prove who owns it.
Since there’s been so much interest in NFTs I thought I’d have a go at learning how to create and ship a collection of my own. Looking back, I’m sure there are far better ways to go about this than the approach I ended up taking! It did, however, give me an opportunity to mess about in Photoshop and acquire a few new coding skills.
For my NFT collection I opted for a pixel art theme inspired by the Nintendo Game Boy.
First I worked by hand in Photoshop (3200% magnification FTW!) to draw lots of different variations for each of the parts I wanted to include in my collection. This is what the full set looks like:
To turn the parts into completed images I wrote a Python program for compositing and outputting them as 800×800px PNG files, using the Pillow imaging library. Here’s an illustration of the steps to build one of the finished items:
A fun feature of lots of PFP collections is having some traits that are very common, while others are more scarce. To achieve this in my collection I incorporated probability distributions to govern the likelihood of different parts being selected or combined with others.
I also specified how many items to generate overall, in order to cap the collection at a sensible size rather than cycling through all possible permutations.
More sophisticated collections than mine mint each item when someone interacts with the project’s smart contract. I had enough on my plate at the time without learning Solidity, so I opted instead to list directly on an NFT marketplace that supports lazy minting.
After a bit of research I chose OpenSea, a popular marketplace that supports the Polygon blockchain. Polygon is built on top of Ethereum and doesn’t have gas fees for creating or transferring NFTs, so it’s great for experimenting.
In the absence of an API for bulk uploading I used the standard web interface, and automated the process for creating and listing items using Pyautogui. To populate the list of traits for each item I pulled from a data table that was saved when the collection was generated.
The final collection contains 1,280 unique items. Some traits appear often, while others appear occasionally – and some appear just once.
Once my NFTs were live on OpenSea I stood up a simple microsite to go along with them. This wasn’t strictly necessary, but I thought it would be a nice way to showcase my project and make it easier to share on social media.
Here are my top three takeaways from this project:
And three things I want to try next time:
Thanks for reading to the end! Feel free to reach out with any questions – and if you want to own your very own super awesome Game Boy Buddy then head over to the collection page and see what’s available 😉