facebook

Automatically create NFT images using HashLips art

Calender

9th January 2022

Clock

5 min read

Author
Vishal Yadav

Technical Project Manager

Introduction: 

Hashlips art engine is used to automatically generate the instance of multiple arts based on the different layers.

In order to generate the image, we need to upload the image layer/traits that the code will pick to generate art. In order to do that we need to create a folder named "layer" in the root directory of the project. Now suppose if we want to create art for the face we can create multiple folders like head, eye, nose, and ears inside the layer. Inside this folder, we can put a different images for eyes like blue, brown, black eyes.

Now code will use this randomly pick an image from each layer in order to create art. Also customize order by 

 

Step 1: Project setup and installing dependency


//Clone project
git clone https://github.com/HashLips/hashlips_art_engine.git
// Install dependency
npm install


 

Step 2: Uploading images layers

Upload all image layer layers, folders as mentioned above.

 

Step 3: Configure setting

Now we need to configure the setting to generate art. Go to folder src/config.js and in layer configurations, we need to mention how much art you want to generate in "growEditionSizeTo" after that in "layersOrder" you need to mention which layer to use during the build process. You can also use different types of layers please see the example below.

const layerConfigurations = [
  {
    // Creates up to 10 artworks
    growEditionSizeTo: 10,
    layersOrder: [
      { name: "Eye" },
      { name: "Hair" },
      { name: "Mouth" },
      { name: "Nose" },
      { name: "Ear" },
      { name: "Headwear" },
    ],
  },
  {
    // Creates an additional 40 artworks
    growEditionSizeTo: 50,
    layersOrder: [
      { name: "Eye" },
      { name: "Hair" },
      { name: "Mouth" },
      { name: "Nose" },
      { name: "Ear" },
      { name: "Headwear" },
      { name: "Mask" },
    ],
  },
];


 

Step 4: Build images


npm run build  // You can check all the generated images in the build folder.

 

Conclusion: Using this tool you can easily generate thousands of artworks in a few simple steps.
 

Table of Content

    Author Vishal Yadav

    Vishal is a highly skilled backend developer with extensive 3+ years experience in developing various blockchain platforms. He has a comprehensive understanding of the technologies and has hands-on expertise in Node.js, Ethereum, Layer 1 and Layer 2 solutions, smart contract development, and databases like MySQL and MongoDB. He has a proven track record of working on a range of blockchain-related projects, including token development, staking, governance, indexes, bridges, NFT, marketplace, ICO/IDO, and more. He is adept at managing trading bots, and developing centralized exchanges, and has a creative mind with excellent analytical skills.

    Technical Project Manager

    bg bg

    What's Trending in Tech

    bg

    Our Offices

    India

    INDIA

    DG-18-009, Tower B,
    Emaar Digital Greens, Sector 61,
    Gurugram, Haryana
    122011.
    Unit- 117-120, First Floor,
    Welldone Tech Park,
    Sector 48, Sohna road,
    Gurugram, Haryana
    122018.
    USA

    USA

    30N, Gloud St STR E, Sheridan, Wyoming (USA) - 82801
    Singapore

    SINGAPORE

    10 Anson Road, #13-09, International Plaza Singapore 079903.

    By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.