Skip to content

Commit b549320

Browse files
authored
Merge pull request #8 from HashLips/dev
Windows delimiter fix
2 parents efc9509 + 88a8ce6 commit b549320

27 files changed

Lines changed: 189 additions & 75 deletions

README.md

Lines changed: 105 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,139 @@
1-
# Welcome to HashLips
1+
# Welcome to HashLips 👄
2+
3+
![](https://github.com/HashLips/hashlips_art_engine/blob/main/logo.png)
24

35
All the code in these repos was created and explained by HashLips on the main YouTube channel.
46

57
To find out more please visit:
68

7-
[HashLips YouTube](https://www.youtube.com/channel/UC1LV4_VQGBJHTJjEWUmy8nA)
9+
[📺 YouTube](https://www.youtube.com/channel/UC1LV4_VQGBJHTJjEWUmy8nA)
10+
11+
[💬 Telegram](https://t.me/hashlipsnft)
812

9-
[HashLips Telegram](https://t.me/hashlipsnft)
13+
[🐦 Twitter](https://twitter.com/hashlipsnft)
1014

11-
[HashLips Twitter](https://twitter.com/hashlipsnft)
15+
[ℹ️ Website](https://hashlips.online/HashLips)
1216

13-
[HashLips Website](https://hashlips.online/HashLips)
17+
# HashLips Art Engine 🔥
1418

15-
# HashLips Art Engine
19+
![](https://github.com/HashLips/hashlips_art_engine/blob/main/banner.png)
1620

1721
Create generative art by using the canvas api and node js. Before you use the generation engine, make sure you have node.js and yarn installed.
1822

19-
## Installation
23+
## Installation 🛠️
24+
25+
If you are cloning the project then run this first, otherwise you can download the source code on the release page and skip this step.
2026

2127
```sh
2228
git clone https://github.com/HashLips/hashlips_art_engine.git
29+
```
30+
31+
Go to the root of your folder and run this command if you have yarn installed.
2332

33+
```sh
2434
yarn add all
2535
```
2636

27-
## Usage
37+
Alternatively you can run this command if you have node installed.
2838

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`
39+
```sh
40+
npm install
41+
```
42+
43+
## Usage ℹ️
3044

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.
45+
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.
3246

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:
47+
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.
48+
49+
_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:
3450

3551
```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' },
52+
const layerConfigurations = [
53+
{
54+
growEditionSizeTo: 100,
55+
layersOrder: [
56+
{ name: "Head" },
57+
{ name: "Mouth" },
58+
{ name: "Eyes" },
59+
{ name: "Eyeswear" },
60+
{ name: "Headwear" },
61+
],
62+
},
4463
];
4564
```
4665

47-
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
66+
The `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.
67+
68+
Optionally you can now add multiple different `layerConfigurations` to your collection. Each configuration can be unique and have different layer orders, use the same layers or introduce new ones. This gives the artist flexibility when it comes to fine tuning their collections to their needs.
4869

49-
Then optionally, update your `format` size, ie the outputted image size, and the `editionSize`, which is the amount of variation outputted.
70+
_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, then you're `layerConfigurations` and `layersOrder` would look something like this:
71+
72+
```js
73+
const layerConfigurations = [
74+
{
75+
// Creates up to 50 artworks
76+
growEditionSizeTo: 50,
77+
layersOrder: [
78+
{ name: "Background" },
79+
{ name: "Head" },
80+
{ name: "Mouth" },
81+
{ name: "Eyes" },
82+
{ name: "Eyeswear" },
83+
{ name: "Headwear" },
84+
],
85+
},
86+
{
87+
// Creates an additional 100 artworks
88+
growEditionSizeTo: 150,
89+
layersOrder: [
90+
{ name: "Background" },
91+
{ name: "Head" },
92+
{ name: "Eyes" },
93+
{ name: "Mouth" },
94+
{ name: "Eyeswear" },
95+
{ name: "Headwear" },
96+
{ name: "AlienHeadwear" },
97+
],
98+
},
99+
];
100+
```
101+
102+
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.
50103

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

53106
```sh
54107
npm run build
55108
```
109+
110+
or
111+
112+
```sh
113+
node index.js
114+
```
115+
116+
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 all the images as well as single json files that represent each image file. The single json file of a image will look something like this:
117+
118+
```json
119+
{
120+
"dna": "d956cdf4e460508b5ff90c21974124f68d6edc34",
121+
"name": "#1",
122+
"description": "This is the description of your NFT project",
123+
"image": "https://hashlips/nft/1.png",
124+
"edition": 1,
125+
"date": 1731990799975,
126+
"attributes": [
127+
{ "trait_type": "Background", "value": "Black" },
128+
{ "trait_type": "Eyeball", "value": "Red" },
129+
{ "trait_type": "Eye color", "value": "Yellow" },
130+
{ "trait_type": "Iris", "value": "Small" },
131+
{ "trait_type": "Shine", "value": "Shapes" },
132+
{ "trait_type": "Bottom lid", "value": "Low" },
133+
{ "trait_type": "Top lid", "value": "Middle" }
134+
],
135+
"compiler": "HashLips Art Engine"
136+
}
137+
```
138+
139+
That's it, you're done. Hope you create some awesome artworks with this code 👄.

banner.png

431 KB
Loading

layers/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)