/generative-nft-art

Libraries for creating generative art and the associated metadata for use in NFTs

Primary LanguagePythonApache License 2.0Apache-2.0

generative-nft-art

Libraries for creating generative art and the associated metadata for use in NFTs

Quickstart

This package is not (yet) made generic enough to be used from the command line for arbitrary NFT art. However, we hope that the details herein can help you create generative programs that will create fun, unique art with specified rarity gradients.

The most interesting functions in the Python script are highlighted below.

Generating Random Combinations With a Hamming Distance Goal Seek

def generate_nft_metadata(start_num, total_nfts, traits_ratios, acceptable_hamming, static_traits, variable_traits)

Performing the Actual Image Composition Using PIL

def compose_image(combination, bg_color, in_pics_dir)

See Pillow for more information.

Compiling Metadata Statistics For Understanding the Algorithm's Performance

def compile_metadata_statistics(full_list, variable_traits)

Uploading to IPFS Using NFT.Storage

def upload_to_ipfs(api_client, nft, in_pics_dir)

See NFT.Storage for more information.

Generating Sample Images After the Fact for Marketing or Other Analysis

def generate_sample_images(metadata_dir, pics_dir, num_images, num_iterations, output_pics_dir)

Note that this function incorporates hamming distance to ensure that you get a very unique set of sample images.

Wild Tangz

The command line code that started it all was:

python3 src/py/compose.py generate-nfts --total-nfts 4410 --min-hamming 3 --percentages-file tangz/percentages.json

The Astronaut set was generated by hand to ensure that the static-trait flag was set correctly and no odd combinations were created. The final result is now visible on the secondary market via JPG.Store or epoch.art.