I created my own NFT collection of Pixel Art RPG avatars
Published: 2023-09-28 10:10:21

When I was a kid I remember my first videogame was [Super Mario Land](https://www.nintendo.co.uk/Games/Game-Boy/Super-Mario-Land-275902.html). The moment I started playing and seeing the character sprite moving and jumping I was completely hooked. I don't remember how old I was, but I do know I was spending hours playing until the batteries died. I wouldn't even realize the sun went down and I'd often end up playing in complete darkness.

<div>
<p style="text-align: center"><img alt="The grass is rarely greener, but it's always different" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1693921839-0.gif">
</p>
</div>

From there, I started exploring all kinds of video games and genres for the [GameBoy Pocket](https://es.wikipedia.org/wiki/Game_Boy_Pocket). From [Donkey Kong](https://www.nintendo.co.uk/Games/Game-Boy/Donkey-Kong-275550.html), [Kirby's Dream Land](https://www.nintendo.co.uk/Games/Game-Boy/Kirby-s-Dream-Land-275682.html), [Bomberman](https://www.nintendo.co.uk/Games/Game-Boy-Advance/Bomberman-266430.html), and [Wario Land](https://www.nintendo.co.uk/Games/Game-Boy/Wario-Land-Super-Mario-Land-3-275979.html) to the Pokemon series: [Red](https://www.nintendo.co.uk/Games/Game-Boy/Pokemon-Red-Version-266109.html), [Blue](nintendo.co.uk/Games/Game-Boy/Pokemon-Blue-Version-266054.html), [Yellow](https://www.nintendo.co.uk/Games/Game-Boy/Pokemon-Yellow-Version-Special-Pikachu-Edition-266142.html), [Silver](https://www.nintendo.co.uk/Games/Game-Boy-Color/Pokemon-Silver-Version-266120.html), and [Gold](https://www.nintendo.co.uk/Games/Game-Boy-Color/Pokemon-Gold-Version-266076.html).

Later on, I had a [Playstation (PSX)](https://en.wikipedia.org/wiki/PlayStation_(console)) and discovered RPG games through the _Final Fantasy_ series. The whole endeavor of following the adventure of the main character, leveling up, building your team, and improving your gear and skillset over time had a grip over me like nothing else. I was particularly drawn to JRPG titles. Those leaned more toward heavy grinding and a deeper storyline, as well as a particular aesthetic, brighter, more colorful, and upbeat.

<div>
<p style="text-align: center">
 <img alt="final-fantasy-9-fight" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1693927745-0.png" />
</p>
</div>

Although graphics had improved significantly, I still had a predilection for the 16 and 32-bit games with an isometric perspective. Examples of such games were [Final Fantasy VI](https://en.wikipedia.org/wiki/Final_Fantasy_IX), [Breath of Fire IV](https://en.wikipedia.org/wiki/Breath_of_Fire_IV), [Grandia](https://en.wikipedia.org/wiki/Grandia), and [Suikoden 2](https://en.wikipedia.org/wiki/Suikoden_II) to name a few, but I could go on with many more.

<div>
<p style="text-align: center">
 <img alt="grandia-fight" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1693928609-0.png" />
</p>
</div>

This love for the pixel art world has stayed constant over time. I'd follow and sporadically play new pixel-art JRPGs, I also used to print pixel-art posters for decoration. A very good friend of mine even did a papercraft model of **Vivi Ornitier** from Final Fantasy IX because he knew I was amazed at the character:

<div>
<p style="text-align: center">
 <img alt="grandia-fight" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1693942695-0.jpg" />
</p>
</div>

Finally, when I was a recent graduate from college, I wanted to do something fun and flashy for my personal portfolio to stand out while looking for a job, so I implemented an interactive portfolio using [Phaser.js](https://phaser.io/). The idea was to make it look like a JRPG game level with a character that could move around and interact with different objects representing each section of a CV. It wasn't of much quality but it was really fun 🕺.

<div>
<p style="text-align: center">
 <img alt="phaser-portfolio-gif" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1693944604-0.gif" />
</p>
</div>

## Generative AI and NFTs

I have been getting increasingly interested for a while in blockchain, crypto, and more recently generative AIs.

The appearance of _text-to-image_ AI generators blew my mind. First I came to know about _OpenAI's_ [DALL-E](https://openai.com/dall-e-2) which I played with for a bit, especially simple prompts with different art styles to marvel at how a penguin or a flower could be portrayed through _Impressionism_, _Realism_, or _Renaissance_.

I then played for a bit with [Stable Diffusion](https://stability.ai/) and it was mind-bending. I even tried to run it locally on my Macbook and almost get **cooked Macbook**.

The level of detail in the images that were generated by these models made me realize we are at the beginning of a computing revolution. I've primarily dabbled with _text-to-image_ models and tried _image-to-image_ a couple of times, but I can only imagine the possibilities for creators, artists, and designers. It is a huge powerful tool. Moreover, a friend of mine showed me the _inpainting_ plugin for Adobe Photoshop (which he now uses daily), and I was taken aback.

<hr>

_Non-Fungible Tokens_ or _NFTs_ are based on the [ERC-21](https://ethereum.org/en/developers/docs/standards/tokens/erc-721/) standard. They represent unique, non-fungible tokens. As opposed to an [ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) token in the _Ethereum_ blockchain, these can be traded but each of them represents their own entity. The common example of a _fungible token_ is any 5€ bill that can be swapped for any other and they represent the same value. NFTs each have a unique identifier, that along with custom metadata makes the token identifiable and traceable across the blockchain transaction history. **Patrick Collins** explains the whole ballgame quite nicely in [his YouTube channel](https://www.youtube.com/watch?v=9yuHz6g_P50):

{% youtube 9yuHz6g_P50 %}

NFTs can have some metadata associated with them. It can be an image, a gif, a video, or even a piece of ownership.

They started out initially focused on digital art, and ever since, plenty of artists, creators, and hobbyists, have jumped on the NFT wagon. Very well-known NFT art collections are the [Bored Ape Yacht Club](https://boredapeyachtclub.com/) and the [CoolCats](https://coolcats.com/). Nowadays you can invest, trade, and exchange NFTs in multiple marketplaces like [OpenSea](https://opensea.io/), [Rarible](https://rarible.com/), and [SuperRare](https://superrare.com/).

Some other uses for NFTs are [ticketing](https://www.seatlabnft.com/), [virtual real estate](https://www.sandbox.game/en/) or even [tokenizing actual real estate](https://realt.co/).

## Motivation

I started scouting [OpenSea](https://opensea.io/) for collections with the _JRPG_, _RPG_, and _Pixel Art_ themes and [didn't](https://opensea.io/collection/art-pixel-strayanimals) [really](https://opensea.io/collection/pixel-man-oneoylz26r) [find](https://opensea.io/collection/rpgnfts80) [much](https://opensea.io/collection/jrpg-characters).

Then I thought to myself that it would be cool to have a collection of NFTs that evoked those characters from the JRPG games I love. And, for them to be generated using a combination of classes, traits, attributes, and gear so that no two characters would be the same. Getting that collectibles vibe on.

## Creating the NFT Collection

I set out to create 64 different images by combining three different sets: character classes, color schemas, and weapons. I decided to keep it very simple.

I asked **ChatGPT** to generate 20 different prompts to feed the AI model using the prompt:

> I want to generate a bunch of prompts that will be used to generate images using machine learning. To do that, I will give you a list of classes, a list of colors, and a list of weapons. I want you to write 20 prompts that I can use to generate images by combining these groups of words. The classes are barbarian, druid, wizard, paladin, priest, warlock, and shaman. The colors are blue, red, green, yellow, pink, white, and black. The weapons are scepter, axe, sword, two swords, bow, hammer.

The result of executing the prompt is a list of character descriptions featuring the class, color scheme, and weapon of choice. Here are a couple of examples of the generated output:

* A shaman with tribal tattoos, wearing a headdress of feathers and bones, holding a mystical green gem.
* A barbarian warrior swinging a massive hammer, covered in yellow war paint, ready for battle.

Descriptive, succinct, and to the point. On to the next step.

The next step in line is to feed each prompt to a _text-to-image_ AI generator and generate 4 images per prompt to get some variability within the same description. For the `A shaman with tribal tattoos, wearing a headdress of feathers and bones, holding a mystical green gem.` prompt, here is an example of a generated image:

<div>
<p style="text-align: center">
 <img alt="final-fantasy-9-fight" src="https://bear-images.sfo2.cdn.digitaloceanspaces.com/esteban-1694433781-0.png" />
</p>
</div>

The final step was to create a collection in [OpenSea](https://opensea.io/) with the generated characters. I chose this platform as 98% of the NFT traffic goes through their portal, and listing NFTs comes [at no cost for the winter](https://opensea.io/blog/announcements/introducing-the-collection-manager/) using _lazy minting_.

I created each of the NFTs manually, this was a proof-of-concept so I didn't want to dive into the particularities of programmatically automating the image generation and listing on the marketplace. Eventually, I want to learn more about how to streamline a similar workflow of `image generation > minting NFT > announce the thing somewhere`.

Additionally, I assigned each NFT with different **Traits** based on the class, color scheme, alternative color scheme, weapon, and alternative weapon.

I set a price of _0.11 ETH (~174 USD)_ per image at the time of writing.

Finally, what was left was to publish the collection, and then [Role Pixel Guild](https://opensea.io/collection/role-pixel-guild) was born.


## What's next

I want to keep learning more about generative AI and automate the whole process of generating different prompts based on different cues, then feeding those prompts to other models I found in [HuggingFace](https://huggingface.co/) that look amazing, and listing the images I like the most as NFTs.

All in all, although there was no coding involved in this exercise, I very much enjoyed the process of getting to a handful of images I liked and publishing them. If you enjoy JRPGs, pixel art, and the likes as much as myself, consider purchasing one of the NFTs and throw me a message in private if you have any ideas or projects we could work on, I feel the new wave of AI is just starting.

Have fun!