All Projects → Jon-Becker → nft-generator-py

Jon-Becker / nft-generator-py

Licence: MIT License
Unique image & metadata generation using weighted layer collections.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nft-generator-py

nft-collection-generator
Generates images and metadata for a collection of NFTs.
Stars: ✭ 77 (-39.37%)
Mutual labels:  generative-art, nft
nftool
A suite of tools for NFT generative art.
Stars: ✭ 145 (+14.17%)
Mutual labels:  generative-art, nft
samila
Generative Art Generator
Stars: ✭ 750 (+490.55%)
Mutual labels:  generative-art, nft
react-nft-gallery
🖼️ React component to display your NFTs as a gallery
Stars: ✭ 50 (-60.63%)
Mutual labels:  nft
incomplete-guide-to-imx
An attempt to TLDR; Layer 2 development with IMX.
Stars: ✭ 29 (-77.17%)
Mutual labels:  nft
p5-svelte
Easily add p5 sketches to a Svelte project 🍛 🌱
Stars: ✭ 94 (-25.98%)
Mutual labels:  generative-art
nft.storage-tools
🛠 Utilities for working with nft.storage.
Stars: ✭ 15 (-88.19%)
Mutual labels:  nft
jsartoolkit5
Javascript ARToolKit v5.x
Stars: ✭ 37 (-70.87%)
Mutual labels:  nft
wordpress-nft-plugin
NFT Auction Product Type WordPress Plugin for WooCommerce – BID HAUS
Stars: ✭ 197 (+55.12%)
Mutual labels:  nft
lootloose.com
LootLoose lets you unbundle your Loot Bags into individual item NFTs or rebundle items into their original Loot Bags.
Stars: ✭ 33 (-74.02%)
Mutual labels:  nft
pixel-avatars
A Polygon-based minting projects for Developer DAO members who own an Devs for Revolution NFT
Stars: ✭ 117 (-7.87%)
Mutual labels:  nft
svgnft
Making it slightly easier to create fully on-chain SVG-based NFTs.
Stars: ✭ 44 (-65.35%)
Mutual labels:  nft
kalwalt-interactivity-AR
Some various experiments with Ar.js and Three.js
Stars: ✭ 65 (-48.82%)
Mutual labels:  nft
vpype-pixelart
Pixel art plotting in vpype
Stars: ✭ 40 (-68.5%)
Mutual labels:  generative-art
lines
A plotter-friendly 3D engine
Stars: ✭ 40 (-68.5%)
Mutual labels:  generative-art
CryptoPunks
Subgraph for the Cryptopunks marketplace
Stars: ✭ 37 (-70.87%)
Mutual labels:  nft
tenk
Template for making a NFT contract with a raffle of tokens
Stars: ✭ 32 (-74.8%)
Mutual labels:  nft
webflow-nft-components
Connect web3 to Webflow without coding skills
Stars: ✭ 69 (-45.67%)
Mutual labels:  nft
Generative-Art-Sketches
A Generative Art Gallery with the idea of creating a virtual Art Gallery with my creations. I have tried my hands on creating some visually appealing art using Cellular Automata, Recursive Grammar, Phyllotaxis, Sandpiles, Perlin Noise, IFS, Tiling.
Stars: ✭ 24 (-81.1%)
Mutual labels:  generative-art
elven-nft-minter-sc
Elven Tools SC - Smart Contract for launching NFTs collections on the Elrond blockchain
Stars: ✭ 30 (-76.38%)
Mutual labels:  nft

nft-generator-py

preview

nft-generator-py is a python based NFT generator which programatically generates unique images using weighted layer files. The program is simple to use, and new layers can be added by adding a new layer object and adding names, weights, and image files to the object. You can View The Demo here.

How it works

  • A call to generate_unique_images(amount, config) is made, which is the meat of the application where all the processing happens.
  • The config object is read and for each object in the layers list, random values are selected and checked for uniqueness against all previously generated metadata files.
  • Once we have amount unique tokens created, we layer them against eachother and output them and their metadata to their respective folders, ./metadata and ./images.

Configuration

{
  "layers": [
    {
      "name": "Background",
      "values": ["Blue", "Orange", "Purple", "Red", "Yellow"],
      "trait_path": "./trait-layers/backgrounds",
      "filename": ["blue", "orange", "purple", "red", "yellow"],
      "weights": [30, 45, 15, 5, 10]
    },
    ...
  ],
  "incompatibilities": [
    {
      "layer": "Background",
      "value": "Blue",
      "incompatible_with": ["Python Logo 2"]
    },
  ],
  "baseURI": ".",
  "name": "NFT #",
  "description": "This is a description for this NFT series."
}

The config object is a dict that contains configuration instructions that can be changed to produce different outputs when running the program. Within metadata files, tokens are named using the configuration's name parameter, and described using the description parameter.

  • In ascending order, tokenIds are appended to the name resulting in NFT metadata names such as NFT #1.
  • tokenIds are padded to the largest amount generated. IE, generating 999 objects will result in names NFT #1, using the above configuration, and generating 1000 objects will result in NFT #1.
  • As of v1.0.2, padding filenames has been removed.

The layers list contains layer objects that define the layers for the program to use when generating unique tokens. Each layer has a name, which will be displayed as an attribute, values, trait_path, filename, and weights.

  • trait_path refers to the path where the image files in filename can be found. Please note that filenames omit .png, and it will automatically be prepended.
  • weight corresponds with the percent chance that the specific value that weight corresponds to will be selected when the program is run. The weights must add up to 100, or the program will fail.

The incompatibilities list contains an object that tells the program what layers are incompatible with what. In the above configuration, A Blue Background layer will never be generated with Python Logo 2.

  • layer refers to the targeted layer.
  • value is the value of the layer that is incompatible with attributes within the incompatible_with list.
  • incompatible_with is the list of incompatible layers that will never be selected when layer has attribute value.

As of v1.0.2, the IPFS CID may be updated programatically after generating NFTs and uploading /images to IPFS. This will update all metadata files to correctly point "image" to the IPFS CID.

  • This is an optional step, and can be exited safely using enter or control + c.

Troubleshooting

  • All images should be in .png format.
  • All images should be the same size in pixels, IE: 1000x1000.
  • The weight values for each attribute should add up to equal 100.

Credits

This project is completely coded by Jonathan Becker, using no external libraries.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].