Docs
Art Engine
Core Plugins
Exporters
Images

Images Exporter

The Images Exporter plugin plays a crucial role in the Art Engine's export process, allowing the easy retrieval and organization of images generated during the rendering process. This plugin takes the data from the renderer, locates the related images saved in the temporary folder, and then copies and renames these files into the specified output directory. The Images Exporter ensures that the rendered images are correctly organized and readily available for further use, such as minting NFTs or showcasing the artwork.

Adding the plugin

  1. Import the plugin object:
const { ArtEngine, exporters } = require("@hashlips-lab/art-engine");
  1. Setup a base path:
const BASE_PATH = __dirname;
  1. Add the plugin to an instance of the Art Engine:
const ae = new ArtEngine({
  cachePath: `${BASE_PATH}/cache`,
  outputPath: `${BASE_PATH}/output`,
  useCache: false,
 
  exporters: [
    new exporters.ImagesExporter({
      imagesFolder: "artwork_images",
    });
    // Add more generators if needed...
  ]
 
  // Add inputs, exporters, renderers as required...
});

Parameters

  • imagesFolder (optional): A string representing the name of the folder where the exported images will be stored. If not provided, a default folder named "images" will be used.

Interfaces

Base

This plugin adheres to the base exporter interface called ExporterInterface.

Custom

The Images Exporter plugin shines a spotlight on the exporter's role within the Art Engine's dynamic ecosystem. This plugin embraces the core exporter interface to facilitate the extraction of image-related data from the rendered outputs, transferring them to their new abode within the output directory.

Here's a glimpse of the Images Exporter in action:

export class ImagesExporter implements ExporterInterface {
  // Implementation details
}

By skillfully integrating the rendersGetter function, the Images Exporter seamlessly accesses the visual content generated by renderer plugins, transferring them with fidelity and precision, thus rendering a rich collection of images ready to grace various mediums and platforms.