NFT collection generator. Generates layered images

Overview

NFT collection generator

Generates layered images, whole collections. Provides additional functionality.

Repository includes three scripts

Installation

pip install -r requirements.txt

generate.py

Generates layered images.

Set environment variables in .env file

/ URL_TO_IMAGE=change_me_later COLLECTION_SIZE=10 # metadata files have field "name": # like CryptoPunk #10 NAME=NAME PATH_TO_JSON=./layers.json PATH_TO_LAYERS=./layers PATH_TO_IMAGES=./images PATH_TO_METADATA=./metadata">
# metadata files have field "image 
      
       /
       
      
URL_TO_IMAGE=change_me_later
COLLECTION_SIZE=10
# metadata files have field "name": 
      
        #
       
         like CryptoPunk #10
       
      
NAME=NAME
PATH_TO_JSON=./layers.json
PATH_TO_LAYERS=./layers
PATH_TO_IMAGES=./images
PATH_TO_METADATA=./metadata

layers.json

{
    "first-layer": [
        {
            "name": "name",
            "fileName": "filename.png",
            "weight": 100
		}
    ]
}

Main JSON objects like first-layer should equal folders inside ./layers and objects names will equal attributes names in metadata files.

Note: sum of wheights inside one main object should equal 100

Run

python generate.py

resize.py

This script scales your images. Marketplace doesn't display small images like 12 pixels images correctly.

Set environment variables in .env file

PATH_TO_IMAGES=./images
# path for resized images
PATH_TO_RESIZED_IMAGES=./images-resized
# new sizes
OUTPUT_IMAGE_SIZE_X=576
OUTPUT_IMAGE_SIZE_Y=576

###Run

python resize.py

change_url.py

This script change image field in metadata files.

Set environment variables in .env file

URL_TO_IMAGE=change_me_later
NEW_URL_TO_IMAGE=ipfshash
PATH_TO_METADATA=./metadata

Run

python change_url.py

License

Usage is provided under the MIT License. See LICENSE for the full details.

You might also like...
This is a new web-based photo management application. Run it on your home server and it will let you find the right photo from your collection on any device. Smart filtering is made possible by object recognition, location awareness, color analysis and other ML algorithms. A collection of python scripts which help you programatically create PNGs or GIFs
A collection of python scripts which help you programatically create PNGs or GIFs

A collection of python scripts which help you programatically create PNGs or GIFs and their Metadata in bulk with custom rarity rates, upload them to OpenSea & list them for sale.

Collection of SVG diagrams about how UTF-8 works

Diagrams Repository of diagrams made for articles on my blog. All diagrams are created using diagrams.net. UTF-8 Licenses Copyright 2022 Seth Michael

Python avatar generator for absolute nerds

pagan Welcome to the Python Avatar Generator for Absolute Nerds. Current version: 0.4.3 View the change history here. Remember those good old days whe

Python QR Code image generator

Pure python QR Code generator Generate QR codes. For a standard install (which will include pillow for generating images), run: pip install qrcode[pil

Samila is a generative art generator written in Python
Samila is a generative art generator written in Python

Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.

A Robust Avatar Generator with a huge number of templates

CoolAvatars Welcome to this repository of CoolAvatars. Using this project, you can generate cool avatars not only from the samples present in my image

Create a QR-code Generator app using only Python.

QR-code_Generator Create a QR-code Generator app using only Python. This apps generated a QR code for a single link. Libraryes used in this app -- py

Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

Comments
  • python3 generate.py not responding

    python3 generate.py not responding

    No errors, no nothing, it just hangs... unless I Ctrl + C, in which case this happens

    ~/nft-collection-generator# python3 generate.py
    ^CTraceback (most recent call last):
      File "generate.py", line 107, in <module>
        main()
      File "generate.py", line 77, in main
        new_image = generate_image(data)
      File "generate.py", line 16, in generate_image
        image[layer] = random.choices([x["name"] for x in data[layer]], [
      File "generate.py", line 16, in <listcomp>
        image[layer] = random.choices([x["name"] for x in data[layer]], [
    KeyboardInterrupt
    

    I have 3 layers - main, border, motif. filenames are main (1).png... main (16).png, border (1).png ... border (8).png, motif (1).png ... motif (6).png. weights for main, border and motif are 100 each in total.

    {
        "main": [
            {
                "name": "main",
                "fileName": "main (1).png",
                "weight": 6
            },
    .
    .
    .
            {
                "name": "main",
                "fileName": "main (16).png",
                "weight": 7
            },
        ],
        "border": [
            {
                "name": "border",
                "fileName": "border (1).png",
                "weight": 12
            },
    .
    .
    .
            {
                "name": "border",
                "fileName": "border (8).png",
                "weight": 13
            },
        ],
       "motif": [
            {
                "name": "motif",
                "fileName": "motif (1).png",
                "weight": 16
            },
    .
    .
    .
            {
                "name": "motif",
                "fileName": "motif (6).png",
                "weight": 17
            },
        ]
    }
    

    And .env is

    URL_TO_IMAGE=test_col1
    NEW_URL_TO_IMAGE=new_test_col1
    
    COLLECTION_SIZE=768
    NAME=test_col1
    PATH_TO_JSON=./layers.json
    PATH_TO_LAYERS=./layers
    PATH_TO_IMAGES=./images
    PATH_TO_METADATA=./metadata
    
    PATH_TO_RESIZED_IMAGES=./images-resized
    OUTPUT_IMAGE_SIZE_X=576
    OUTPUT_IMAGE_SIZE_Y=576
    

    Images are 491x93 px, around 90kb to 400kb in size. Even renaming all to main_10.png doesn't work. Where did I do wrong?

    Thanks a lot!

    opened by C-Fu 2
Owner
Gleb Gonchar
Young Backend Developer
Gleb Gonchar
Combinatorial image generator for generative NFT art.

ImageGen Stitches multiple image layers together into one image. Run usage: stitch.py [-h] <backgrounds_dir> <dinos_dir> <traits_dir> <texture_file> <

Dinosols NFT 19 Sep 16, 2022
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

Kartikay Bhutani 8 Sep 21, 2022
Convert bitmap images to seeds for Tiny-83 NFT project.

What is this? This tool allows you to convert any 14p high and 22p wide Bitmap (.bmp) to the seed needed for the Tiny-83 NFT project. Project Twitter:

shib_maximalist 1 Oct 31, 2021
Generates images of calendar month tables and can paste them onto suitable photos.

?? calendizer README Generates images of calendar month tables and can paste them onto suitable photos. A quick way to make your own calendar for prin

Sean Ryan 2 Dec 14, 2022
QR-Generator - An awesome QR Generator to create or customize your QR's

QR Generator An awesome QR Generator to create or customize your QR's! Table of

Tristán 1 Jan 28, 2022
Ascify-Art - An easy to use, GUI based and user-friendly colored ASCII art generator from images!

Ascify-Art This is a python based colored ASCII art generator for free! How to Install? You can download and use the python version if you want, modul

Akash Bora 14 Dec 31, 2022
Anime2Gif - an algorithm that detects scenes in a video and generates gifs from it

Anime2Gif Anime2Gif is an algorithm that detects scenes in a video and generates gifs from it. How to use To use it, first, you'll need to install it'

null 1 Dec 9, 2021
Tool that takes your photo and generates a pixelated color by number photo.

Color by number Tool that takes your photo and generates a pixelated color by number photo. Requirements You need to have python installed on your com

null 1 Dec 18, 2021
Parking management project which generates barcode parking ticket with user-friendly Tkinter program GUI

Parking-management-system Parking management project which generates barcode parking ticket with user-friendly Tkinter program GUI How to run Download

null 1 Jul 3, 2022
missing-pixel-filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled.

Missing Pixel Filler This is the official code repository for the Missing Pixel Filler by SpaceML. missing-pixel-filler is a python package that, give

SpaceML 11 Jul 19, 2022