Automatically create NFT images using HashLips art

Posted By : Vishal

Dec 27, 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.
 

Leave a

Comment

Name is required

Invalid Name

Comment is required

Recaptcha is required.

blog-detail

November 21, 2024 at 11:34 am

Your comment is awaiting moderation.

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.

Chat with Us
Telegram Button
Youtube Button

Contact Us

Oodles | Blockchain Development Company

Name is required

Please enter a valid Name

Please enter a valid Phone Number

Please remove URL from text