A collection of python scripts which help you programatically create PNGs or GIFs

Overview

OpenSea PNG/GIF NFT Creator

Description

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.

In /Generate/ is the generator script for programmatically creating images.

In /Upload/ there is an uploader script that logs into your OpenSea account via Selenium and metamask chrome plugin to bulk upload NFT to your collection. This part of the collection was customised from https://github.com/lakshyabatman/Bulk-uploader-NFT

Inside /List/ there are a set of scripts to help you grab all your collection links and metadata information so that you can then set a price in Eth within the AssetLinks.csv and list them for sale. This was quite a tricky issue to solve as there is no bulk sell feature in OpenSea but this does automate the listing process.

Whilst this is an easy, hands-off way of uploading/listing your NFTs it takes time and isn't as efficient as having API access. I might update some of the functionality to use OpenSea's API in the future but for now you may want to run the upload process over night when you don't need your machine.

I've created a few example assets/images for the purpose of demoing this project. Feel free to do what you like with them.

You can check out the OpenSea NFT collection I made with this project here: https://opensea.io/collection/ether-swimmers/

If this proves useful to you or you get NFT rich consider buying me a coffee:

Buy Me A Coffee

Before you get started

Accounts

  • Get a metamask wallet and the Chrome extension.
  • Sign up to OpenSea using a metamask wallet.

Install Requirements

  • pip install -r requirements.txt
  • Make sure you have chrome driver installed.
  • Create .env from .example.env with required keys.

Create your PNG assets

  • Create your assets and put them in folders within the /Assets/ folders.
  • Recommended image size is 300x300 but there is code to resize images automatically.
  • Rename your assets to numbers such as 1.png, 2.png, 3.png etc and put them in the right folders. This makes it easier to work with a dictionary to generate metadata.

Generating your NFTs

Configure the Generator Script

  • Follow the comments in the script.
  • Setup your dictionarys of asset information for NFT metadata.
  • Configure the image output for PNG/GIF.

Start generating

  • Open Execute.py and change the NumberOfNFTS.
  • Run the script.
  • The generator script will put strings of numbers into a GenerationIDs csv this is used to stop duplicate NFTs. If you need to rerun the generator from scratch, make sure to clear the IDs so that you aren't limited.
  • There will be a metadata JSON file for each image. These will need to be joined by running the MergeJson.py file in the /JSON/ folder. (This could probably be fixed to do automatically at the point of generation).
  • All your images should now be in OutputData/Images.

Uploading to OpenSea

Using UploadNFTs.py

Setup your .env file

  • EXTENSION_PATH: In our program, we're running a selenium based browser (chrome driver here) and usually in automated environment we don't have access to extensions, so get the access.
    • Navigate to chrome://extensions/ Click ‘Pack extension’ and enter the local path to the Metamask extension. This will generate a .crx file. Also, make a note of Extension ID.
    • Now the path to this '.crx' file is the value of this field.
  • RECOVERY_CODE: Recovery code of your wallet cause we need to login into your metamask.
  • PASSWORD: Metamask's password.
  • CHROME_DRIVER_PATH: To run chromium, you need to download the chrome driver and it's path will be the value. (https://chromedriver.chromium.org/downloads)

Note on metamask automation:

  • You have to click the "sign" button during user login on opensea for the first time.
  • Sometimes metamask wants additional "sign" auth on actions which when unattended can stop the scripts.
  • If it fails at any point just rerun, the code is designed to keep track of what has already been uploaded/listed and skip that.
  • You may find that when OpenSea's servers slow down (which happens a lot) this can affect Selenium's timings and cause errors as it tries to click things that don't exist. I've accounted for a fair bit of this behaviour but it doesn't account for every situation.

Setup your OpenSea Collection

  • You will need to input your OpenSea collection URL on line 98 & 134 of UploadNFTs.py. Create your OpenSea collection in your account and grab the link.

Run UploadNFTs.py

Listing for sale on OpenSea

This is long winded but worth it.

Run the scripts in the List folder in this order:

getUrls.py

  • Change the collection URL on line 74
  • This gets all (most) the URLs of the NFTs from the collection
  • This takes a while as it has to scroll through the page to overcome the infinite loader. The more images you have, the longer it'll take.
  • Important! - After you've run this do a Remove Duplicates operation in the CSV to get rid of any URLs which are duplicated.

getProperties.py

  • This gets all the Metadata attributes & their % rarity for the NFT URLs and throws them into AssetLinks.csv.

Important - Price your NFTs

  • Inside AssetLinks.csv add prices to your NFTs in Ethereum before runing

Run list.py

  • This should just run

Phew, you are done and now have a collection of shiny NFTs on OpenSea! Congrats

Owner
Tom
https://www.buymeacoffee.com/tomhar
Tom
BeeRef — A Simple Reference Image Viewer

BeeRef — A Simple Reference Image Viewer BeeRef lets you quickly arrange your reference images and view them while you create. Its minimal interface i

Rebecca 245 Dec 25, 2022
A Gtk based Image Selector with Preview

gtk-image-selector This is an attempt to restore Gtk Image Chooser "lost functionality": displaying an image preview when selecting images... This is

Spiros Georgaras 2 Sep 28, 2022
:rocket: A minimalist comic reader

Pynocchio A minimalist comic reader Features | Installation | Contributing | Credits This screenshots contains a page of the webcomic Pepper&Carrot by

Michell Stuttgart 73 Aug 02, 2022
Make your master artistic punk avatar through machine learning world famous paintings

Master-art-punk Make your master artistic punk avatar through machine learning world famous paintings. 通过机器学习世界名画制作属于你的大师级艺术朋克头像 Nowadays, NFT is beco

蒋虎成 23 Jan 04, 2022
This piece of code is a User Welcomer with Image Manipulation using Python and Pillow (PIL).

This piece of code is a User Welcomer with Image Manipulation using Python and Pillow (PIL).

Bero 4 Jan 11, 2022
Image histogram remapping

Hmap An image histogram remapping script written in Python 2.7 by Anthony Kesich and Ross Goodwin. Changes source image so that source image's histogr

Ross Goodwin 199 Nov 19, 2022
Convert the SVG code to PNG and replace the line by a call to the image in markdown

Convert the SVG code to PNG and replace the line by a call to the image in markdown

6 Sep 06, 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
A large-scale dataset of both raw MRI measurements and clinical MRI images

fastMRI is a collaborative research project from Facebook AI Research (FAIR) and NYU Langone Health to investigate the use of AI to make MRI scans faster. NYU Langone Health has released fully anonym

Facebook Research 907 Jan 04, 2023
🎨 Generate and change color-schemes on the fly.

Generate and change color-schemes on the fly. Pywal is a tool that generates a color palette from the dominant colors in an image. It then applies the

dylan 6.9k Jan 03, 2023
A small Python module for BMP image processing.

micropython-microbmp A small Python module for BMP image processing. It supports BMP image of 1/2/4/8/24-bit colour depth. Loading supports compressio

Quan Lin 4 Nov 02, 2022
Sombra is simple Raytracer written in pure Python.

Sombra Sombra is simple Raytracer written in pure Python. It's main purpose is to help understand how raytracing works with a clean code. If you are l

Hernaldo Jesus Henriquez Nuñez 10 Jul 16, 2022
ProsePainter combines direct digital painting with real-time guided machine-learning based image optimization.

ProsePainter Create images by painting with words. ProsePainter combines direct digital painting with real-time guided machine-learning based image op

Morphogen 276 Dec 17, 2022
Converting Images Into Minecraft Houses

Converting Images Into Minecraft Houses In this particular project, we turned a 2D Image into Minecraft pixel art and then scaled it in 3D such that i

Mathias Oliver Valdbjørn Jørgensen 1 Feb 02, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
Change the image one color channel at a time.

Building-a-Contact-Sheet This hands-on Project is in Python 3 Programming Specialization offered by University of Michigan via Coursera. change the im

Eszter Pai 1 Jan 03, 2022
Seaborn-image is a Python image visualization library based on matplotlib and provides a high-level API to draw attractive and informative images quickly and effectively.

seaborn-image: image data visualization Description Seaborn-image is a Python image visualization library based on matplotlib and provides a high-leve

48 Jan 05, 2023
Raven is a tool written in Python3 allowing you to generate an unique image with some text.

🐦 Raven is a tool written in Python3 allowing you to generate an unique image with some text. It does it by searching the text on Google, do

Billy 39 Dec 20, 2022
Py3D - A 3d rendering engine written entirely in python

Py3D is a 3d rendering engine written entirely in python. It is a simple and eas

1up Community 2 Nov 14, 2022
Convert any image into greyscale ASCII art.

Image-to-ASCII Convert any image into greyscale ASCII art.

Ben Smith 12 Jan 15, 2022