Automatically create NFT images using HashLips art

Posted By : Vishal Yadav | 27-Dec-2021

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.
 

About Author

loading
Vishal Yadav

Vishal, a backend blockchain expert, has expertise in platforms like Ethereum, Binance, and more. He develops smart contracts like ERC20 and ERC721 (NFT) for staking, governance, and more. He also manages trading bots development and works on MongoDB, AWS

Leave a Comment

Name is required

Comment is required

Recaptcha is required.

No Comments Yet.

    Request For Proposal

    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.

    We would love to hear from you!

    Oodles | Blockchain Development Company

    Please enter a valid Phone Number

    Please remove URL from text

    Recaptcha is required.