exported the generateRandomImage function :)

This commit is contained in:
2024-03-22 13:32:01 +01:00
parent 90c5f9ec8e
commit 8bb360b751
4 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
# generative-art
# layered-generative-art
An easy-to-use library to generate random images from a set of layers.
## Installation

View File

@@ -3,6 +3,7 @@ import dts from "bun-plugin-dts";
await Bun.build({
entrypoints: ["./src/index.ts"],
outdir: "./dist",
target: "node",
minify: true,
plugins: [dts()],
});

View File

@@ -9,7 +9,8 @@
"module": "index.ts",
"license": "MIT",
"files": [
"dist"
"dist/*.js",
"dist/*.d.ts"
],
"keywords": [
"generative",
@@ -25,6 +26,10 @@
"url": "git+https://github.com/4-0-9/layered-generative-art.git"
},
"bugs": "https://github.com/4-0-9/layered-generative-art/issues",
"scripts": {
"build": "bun run build.mjs",
"publish": "bun run build && npm publish"
},
"dependencies": {
"sharp": "^0.33.2"
},

View File

@@ -6,7 +6,7 @@ import { type Layer, type TraitOption } from './layers';
* @param orderedLayers - The layers to choose from in ascending order
* @returns A buffer containing the newly generated image
*/
async function generateRandomImage(baseShapePath: string, orderedLayers: Layer[]): Promise<GenerativeArtOutput> {
export async function generateRandomImage(baseShapePath: string, orderedLayers: Layer[]): Promise<GenerativeArtOutput> {
const layers: OverlayOptions[] = [];
const choices: Record<string, string> = {};