GithubHelp home page GithubHelp logo

nft-image-generator's Introduction

About

Python Notebook in Jupyter that will generate a series of unique images using a collection of layers.

Getting Started

  1. Install Python

  2. Install PIP Download PIP get-pip.py

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py
  1. Install requirements
pip install -r requirements.txt
  1. Run Jupyter in your nft-image-generator folder
jupyter notebook
  1. Run the commands in [generate.ipynb] to generate images.

  2. First time you run notebook, it will ask you to install ipykernel, accept this.

  3. If the program executes successfully, it will output all the generated images to the /images folder, and the metadata to the /metadata folder. The filenames will refer to tokenIds.

nft-image-generator's People

Contributors

bachetesla avatar benyaminahmed avatar buddybob avatar yusufahmed-ya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nft-image-generator's Issues

IMAGES_BASE_URI

Not so much an issue, more a question.

IMAGES_BASE_URI

Under the meta_data generation line, this needs to be input manually correct? So if I was to upload onto IPFS, I would need to manually go in and add the IPFS link.

Thanks!

Thankyou

made my 10000 images with 5 layers . The hard part was the Image.alpha_composite
love from India . You are a legend in this country

you introduced me to NFT actually
Do continue coding

editin python code w/ 4 variables

hi ,
im really new this and i need some help. i change the background to png instead of jpg, because my file was a png. But i'm getting this error.would really appreciate some troubleshooting help

im1 = Image.open(f'./layers/background/{background_files[item["background"]]}.png').convert('RGBA')
4 im2 = Image.open(f'./layers/mouth/{mouth_files[item["mouth"]]}.png').convert('RGBA')
5 im3 = Image.open(f'./layers/spoon/{spoon_files[item["spoon"]]}.png').convert('RGBA')

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/Image.py in open(fp, mode, formats)
2966
2967 if filename:
-> 2968 fp = builtins.open(filename, "rb")
2969 exclusive_fp = True
2970

FileNotFoundError: [Errno 2] No such file or directory: './layers/background/purple.png'

How to make a layer optional?

Hello. For example, your Weird Whales have mouth accessories, but not all. Hot to make this layer with mouth accessories optional?

How to make a layer optional?

Hello. For example, your Weird Whales have mouth accessories, but not all. How to make this layer with mouth accessories optional?

What is the use for this application

I successfully ran the application and it has generated some weird images in the images folder. Now I am not sure about the next steps to be followed. Can we upload these images to Opensea? I don't think no one will buy these images and all of them look similar.

Anyone here know what to do ?

Help

I keep getting this error, also is there any way to acutallty have the same name for an image but different images?

Screen Shot 2021-08-31 at 5 45 11 PM

For example I want the traits to have a "bowtie" but that "bowtie" be multiple images. Notice how there's a colorful properties but they're different colors.

Screen Shot 2021-08-31 at 5 47 33 PM

Recursion error

When I set the TOTAL_IMAGES = 10000

I get a recursion error:

RecursionError Traceback (most recent call last)
/var/folders/j7/byspn9bd3rddg31124_fldnm0000gn/T/ipykernel_2323/1847067360.py in
28 for i in range(TOTAL_IMAGES):
29
---> 30 new_trait_image = create_new_image()
31
32 all_images.append(new_trait_image)

/var/folders/j7/byspn9bd3rddg31124_fldnm0000gn/T/ipykernel_2323/1847067360.py in create_new_image()
20
21 if new_image in all_images:
---> 22 return create_new_image()
23 else:
24 return new_image

... last 1 frames repeated, from the frame below ...

/var/folders/j7/byspn9bd3rddg31124_fldnm0000gn/T/ipykernel_2323/1847067360.py in create_new_image()
20
21 if new_image in all_images:
---> 22 return create_new_image()
23 else:
24 return new_image

RecursionError: maximum recursion depth exceeded in comparison

Setting the sys recursion limit to 10k [sys.setrecursionlimit(10000)] doesn't make a difference, in fact the error is throw with any image # above 5775

Any ideas? Thanks!

Maximum recursion depth reached

Thanks a lot for this awesome notebook! One problem I'm running into is I'm hitting the maximum recursion depth when trying to generate more than about 200 images. My setup has 8 layers, with 1-5 variants in each, but if I set TOTAL_IMAGES higher than about 250, I hit the limit. I'm trying to generate 10,000 images, so kind of stuck.

This is the error I'm seeing:

  File "/Users/zac/.pyenv/versions/3.9.4/lib/python3.9/random.py", line 498, in choices
    return [population[bisect(cum_weights, random() * total, 0, hi)]
  File "/Users/zac/.pyenv/versions/3.9.4/lib/python3.9/random.py", line 498, in <listcomp>
    return [population[bisect(cum_weights, random() * total, 0, hi)]
RecursionError: maximum recursion depth exceeded in comparison

One detail is I used nbconvert to convert the notebook to a python script so it can be run via script.

I did find to add this line:

import sys
sys.setrecursionlimit(65532)

However, that just changes the error to segmentation fault when I try to go higher than 250. Any thoughts?

Creating images

When replacing the images I have an error 'ValueError: images do not match'. Does anyone know how the images should be saved? Any advice would be helpful. Thank you!

How are you making the whale images?

I've looked everywhere in your code and can only find squares circles and images. I don't see where you made the accessories like the hats, cigars, and eyes. And where are your whale bases located?

How to run application

Hi there

How does one run this generator within Jupyter?
I've used the generate.ipynb file within Jupyter but nothing happens. It's seems to throw some sort of error. Please if you can maybe explain in more details or upload some screenshots of what the code should look like in order to function?

Thank you.

I need a small bit of guidance

Hello,

Thanks for generating the code. I'm having some difficulties running it. I have tried following the steps you have put out - I installed python, pip, python pillow and have tried several times to get a ui for jupyter notebook. I settled with JupyterLab. However, I don't know how to duplicate my nft image., or the ideal commands to run. Can I have some guidance?

Thanks!

Required trais

Really grateful for the script!
How would you go about specifying whether a trait is required and not roll it at all for some images while omitting it from the list of traits?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.