Skip to content

Commit 3cf7ca6

Browse files
author
Daniel Botha
committed
Updated: readme file
1 parent d95f75b commit 3cf7ca6

1 file changed

Lines changed: 96 additions & 13 deletions

File tree

README.md

Lines changed: 96 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,121 @@ Create generative art by using the canvas api and node js. Before you use the ge
1818

1919
## Installation
2020

21+
If you are cloning the project the run this first, otherwise you can download the source code on the release page and skip this step.
22+
2123
```sh
2224
git clone https://github.com/HashLips/hashlips_art_engine.git
25+
```
26+
27+
Go to the root of you folder and run this command if you have yarn installed.
2328

29+
```sh
2430
yarn add all
2531
```
2632

33+
Alternativly you can run this command if you have node installed.
34+
35+
```sh
36+
npm install
37+
```
38+
2739
## Usage
2840

29-
Create your different layers as folders in the 'layers' directory, and add all the layer assets in these directories. You can name the assets anything as long as it has a rarity weight attached in the file name like so: `example element*70.png`
41+
Create your different layers as folders in the 'layers' directory, and add all the layer assets in these directories. You can name the assets anything as long as it has a rarity weight attached in the file name like so: `example element#70.png`. You can optionally change the delimiter `#` to anything you would like to use in the variable `rarityDelimiter` in the `src/config.js` file.
3042

31-
Once you have all your layers, go into `src/config.js` and update the `layersOrder` array to be your layer folders name in order of the back layer to the front layer.
43+
Once you have all your layers, go into `src/config.js` and update the `layerConfigurations` objects `layersOrder` array to be your layer folders name in order of the back layer to the front layer.
3244

33-
*Example:* If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear, so your `layersOrder` would look something like this:
45+
_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear, so your `layersOrder` would look something like this:
3446

3547
```js
36-
const layersOrder = [
37-
{ name: 'Background'},
38-
{ name: 'Ball'},
39-
{ name: 'Eye color' },
40-
{ name: 'Iris' },
41-
{ name: 'Shine' },
42-
{ name: 'Bottom lid' },
43-
{ name: 'Top lid' },
48+
const layerConfigurations = [
49+
{
50+
growEditionSizeTo: 100,
51+
layersOrder: [
52+
{ name: "Head" },
53+
{ name: "Mouth" },
54+
{ name: "Eyes" },
55+
{ name: "Eyeswear" },
56+
{ name: "Headwear" },
57+
],
58+
},
4459
];
4560
```
4661

47-
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
62+
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
63+
64+
Optionally you can now add multiple different `layerConfigurations` to you collection. Each confugiration can be uinque and have different layer order, use the same layers or intruduce new onces. This gives the artist flexibility when it comes to fine tuning their collections to their needs.
65+
66+
_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear and you want to create a new race or just simple re-order the layers or even introduce new layers, so your `layerConfigurations` and `layersOrder` would look something like this:
67+
68+
`````js
69+
const layerConfigurations = [
70+
{
71+
// Creates upto 50 artworks
72+
growEditionSizeTo: 50,
73+
layersOrder: [
74+
{ name: "Background" },
75+
{ name: "Head" },
76+
{ name: "Mouth" },
77+
{ name: "Eyes" },
78+
{ name: "Eyeswear" },
79+
{ name: "Headwear" },
80+
],
81+
},
82+
{
83+
// Creates an aditional 100 artworks
84+
growEditionSizeTo: 150,
85+
layersOrder: [
86+
{ name: "Background" },
87+
{ name: "Head" },
88+
{ name: "Eyes" },
89+
{ name: "Mouth" },
90+
{ name: "Eyeswear" },
91+
{ name: "Headwear" },
92+
{ name: "AlienHeadwear" },
93+
],
94+
},
95+
];
96+
```
4897

49-
Then optionally, update your `format` size, ie the outputted image size, and the `editionSize`, which is the amount of variation outputted.
98+
Then optionally, update your `format` size, ie the outputted image size, and the `growEditionSizeTo` on each `layerConfigurations` object, which is the amount of variation outputted.
5099

51100
When you are all ready, run the following command and your outputted art will be in the `build` directory:
52101

53102
```sh
54103
npm run build
55104
```
105+
106+
or
107+
108+
```sh
109+
node index.js
110+
```
111+
112+
The program will output all the images in the `build` directory along with the metadata files. Each collection will have a `_metadata.json` file that consists of all the metadata in the collection inside the `build` folder. The `build` folder also will contain alll the images as well as single json files that represents each image file. The single json file of a image will look somthing like this:
113+
114+
````json
115+
{
116+
"dna": "d956cdf4e460508b5ff90c21974124f68d6edc34",
117+
"name": "#1",
118+
"description": "This is the description of your NFT project, remember to replace this",
119+
"image": "https://hashlips/nft/1.png",
120+
"edition": 1,
121+
"date": 1631690799975,
122+
"attributes": [
123+
{ "trait_type": "Background", "value": "Black" },
124+
{ "trait_type": "Eyeball", "value": "Red" },
125+
{ "trait_type": "Eye color", "value": "Yellow" },
126+
{ "trait_type": "Iris", "value": "Small" },
127+
{ "trait_type": "Shine", "value": "Shapes" },
128+
{ "trait_type": "Bottom lid", "value": "Low" },
129+
{ "trait_type": "Top lid", "value": "Middle" }
130+
],
131+
"compiler": "HashLips Art Engine"
132+
}
133+
```
134+
135+
Thats it, your done. Hope you create some awesome artworks with this code.
136+
137+
138+
`````

0 commit comments

Comments
 (0)