Coder Social home page Coder Social logo

occ-flowers-images's Introduction

OCC Flowers IPFS images

This repository contains tooling and data for OCC Flowers, and is free to use without credit or attribution, for any means.

OCC#1 ๐ŸŒบ Flowers is a collection 4096 programatically generated on-chain flowers, for you to own or to share. Each flower is 100% generated on-chain, including it's metadata. No ipfs/arweave, no external rendering script. Just SVGs created by the contract.

What is it?

Flowers are currently stored on-chain in SVG format. This means you can grab the SVG file for a flower directly from the blockchain, no IPFS required. This is amazing, but because they're SVGs, some of which animate, it can be hard to share these beautiful works socially. Most sites don't easily support the SVG format.

This repo generates PNGs, GIFs for the flowers that animate, along with the original SVG files, and stores them on IPFS. This is only so flower enjoyers can more easily share them on things like Twitter and Discord.

โš ๏ธ It's important to note, the assets on IPFS are essentially derivatives of the on-chain data. These are NOT the originals in the tokenURI. They are NOT part of any NFTs. โš ๏ธ

Output

output/images.json contains a mapping of tokenId to the respective image data. The png and gif fields are an IPFS content hash. You can view the image by appending ipfs:// to the content hash, or by using an IPFS gateway by appending https://ipfs.io/ipfs/ to the content hash.

interface Token {
  base64: string;
  svg: string || null;
  png: string || null;
  gif: string || null;
}
{
  "108": {
    "base64": "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAwIDwMC...",
    "svg": "Qmc5UMQ1XotHGNGuxv4kmpQDtWVxL5XHLHTe2SyuJumHUX",
    "png": "Qmc5UMQ1XotHGNGuxv4kmpQDtWVxL5XHLHTe2SyuJumHUX",
    "gif": "QmQvUDaMKZ9LQKkej2649DDSLT3D16mwoXj4p4Jc9x391R"
  }
}

Run locally

If you just want to generate image files locally, you can use the make-svgs, make-pngs, and make-gifs scripts.

However if you want to upload the generated images to IPFS, then you'll need a Pinata JWT access token. The host-ipfs script uses Pinata to pin assets to IPFS. You can provide the JWT by adding a .env file with a PINATA_JWT environment variable.

Bare in mind, these scripts do a lot of rendering. There's 4096 static flowers, and 402 animated flowers. Each script could take a long time to exectute fully depending on your machine.

# Install dependencies
npm install

# Generate SVGs of all the flowers
npm run make-svgs

# Generate PNGs of all the flowers
npm run make-pngs

# Generate GIFs of all the animated flowers
npm run make-gifs

# Upload all the images to IPFS and generate output/images.json
npm run host-ipfs

occ-flowers-images's People

Contributors

samkingco avatar

Watchers

 avatar

Forkers

veekay21

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.