DEV Community

Cover image for NFT images generator with Javascript Nodejs (800,000 cryptopunks)

NFT images generator with Javascript Nodejs (800,000 cryptopunks)

Victor Quan Lam on September 05, 2021

CryptoPunks is one of the most popular NFT projects out there. And now, they are selling for millions of dollars. Yeah I know! Shocking! There are ...
Collapse
 
akunatex profile image
Miguel

Hi Victor, nice work you've been doing, i've used your code to generate some images, but from what i've read also from a post you wrote, the way to publish this amount of images (+100), would be to write a smart contract associated with the images and store them somewhere, then i could create the images on opensea for instance, but even doing so, i would need to create each new image item on opensea or the entire smart contract would be listed on opensea as a collection.
Best regards and keep doing the good work.
Miguel

Collapse
 
jayaych profile image
Jeremy H

Is there a way to use this so that one [blank] background is divided into 6 squares and each of those squares is filled by a random image from a large list (with rarity amounts)?

Sorry if that’s a dumb question: I’m brand new to coding so I barely know what I’m looking at. Any help is super appreciated!

Collapse
 
victorquanlam profile image
Victor Quan Lam

This script won't support with rarity because it will generate every possible combination of the trait layers (aka attributes). You can add rarity of these attributes into the script. However, I have another blog post maybe quiet similar to your idea. It has rarity and different shapes which would be quiet easy to follow especially for beginner.
dev.to/victorquanlam/nft-images-ge...

Collapse
 
jayaych profile image
Jeremy H

Ah that makes sense! Thank you this is extremely helpful!

Collapse
 
flpvdmt profile image
Dmitrii Filippov

Hey!
This page no longer exists
Perhaps you have article on another resource or code example, so please be so kind as to share it)

Collapse
 
mrksta profile image
Marko Matić

For example ->
Aliens/Apes should only ever be assigned “hat” attributes — never “hair” attributes. Logical — as Aliens/Apes don’t grow human hair styles (but Zombies do, of course, as they were formerly humans).

How can we add exceptions? i.e if layer 2.1 is used don't add layer 4.2 ?

Collapse
 
zhurukvova profile image
Vova Zhuruk

Hello Victor! How can I use your script when I have animations instead of images? The animation represented by sequence with PNGs. Like body_gold_01, body_gold_02...body_gold_49, then body_black_01...body_black_49. Where numbers are frames of animation. So I have the same situation like cryptopunks but with difference in animated parts.

I am noob at coding, so if you would help me I will be very glad!

Also, contact to me on Twitter if possible twitter.com/zhurukvova

Collapse
 
nagoadvisory profile image
Nago

Hi Victor, thanks for sharing. This is so cool. I'm helping my son to try to make an NFT and we are stuck at putting in arguments after npm build hehe.... idk why we are struggling..

Can you share a sample example of code one would enter after npm build __________ to create a character. We are messing up on key value pairs, I think?

Collapse
 
victorquanlam profile image
Victor Quan Lam
Collapse
 
zehpierce profile image
Kyle Pierce

Hey, we just launched an NFT generator much like this. However, we are using NodeJS on the frontend, and Golang on the backend. Would you be into reviewing it by any chance?
generate-nft.online

Collapse
 
publr profile image
Publr

How do you use button ? instead of command for this is working

Collapse
 
bibinguyen238 profile image
Bibi Nguyen

congratulate!!!! kkk

Collapse
 
victorquanlam profile image
Victor Quan Lam

Thanks

Collapse
 
wesrajoko profile image
Wesra Joko

Hello mate, how to run this project with nextjs and make a like interface generator with form upload and preview, thanks.

Collapse
 
victorquanlam profile image
Victor Quan Lam

I reckon you can build a UI for it.

Collapse
 
sizkadinlar profile image
sizkadinlar

Can we adapt this to python?

Collapse
 
victorquanlam profile image
Victor Quan Lam

yeah of course

Collapse
 
tikam02 profile image
Tikam Singh Alma

where can we get other attributes to create new NFT collection, obviously we can't sell this one but we can create new one and sell it right.

Collapse
 
victorquanlam profile image
Victor Quan Lam

yeap that's the whole point actually! You can easily add remove trait layers and attributes with this code. It will generate the images for you.

Collapse
 
wagos_dev profile image
Drafly

Hi a, em đã chạy code và nó thật là tuyệt nhưng em k biết làm sao để up ảnh lên web nft mà k bị vỡ, em muốn xin tips từ a ạ

Collapse
 
publr profile image
Publr

I want to use button with in react.js instead of command ,it is node index.js How is it?