From d398e2c86dde02feeacffc6da88e21fe9e8b321e Mon Sep 17 00:00:00 2001 From: shivam Date: Sun, 27 Mar 2022 01:43:55 -0500 Subject: [PATCH] v6 branch --- .README.md.swo | Bin 0 -> 16384 bytes .README.md.swp | Bin 0 -> 16384 bytes 1 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 4 files changed, 60 insertions(+) create mode 100644 .README.md.swo create mode 100644 .README.md.swp create mode 100644 1 diff --git a/.README.md.swo b/.README.md.swo new file mode 100644 index 0000000000000000000000000000000000000000..b05c9f9d49727da3e480744d83c846300e454a08 GIT binary patch literal 16384 zcmeHO&yO5O6|RIR{7i`8gp!~F2eB*d^z52onFR~4cWu0uofv!921UqI(_J%N>+Y&{ zRrSmcQ3wbhK@d2D4@jIq2*Cjof#A+1{{jLbA%P8l0Pwx4?wN5m5#U1vQm^#9J3aN| zy|2FaUe&AiaQ)iuC4MqF&hYaDWA>5L!zW(*`a^%%X3XVkLXZF554Cf>OCmjE%+21G zvPof5Q5@;^6>8Yuk?y89RevnCw8E>2>_$v z@IVOEe$+ep*#0MuZ>&@QV;}tp|KJDqA84qqQ-?r@K!-qwK!-qwK!-qwK!-qw!2c%# zzIvFw4AmcQ)c;iT`=K}den<29U2oB@dEEW#5ac@pwC`#ypL_&^3o`ksf zFm?*^DCBqV#&?h(pb+r|$cG>&-pSaVM;SW}`7ERd`ST-;eFpMr$Ym5So`<}SBFE2R z=g%NyZvi=gybV9c+8@4E6lSXQm}hDG;T4o=WS5((&P}Ux=B+LsJfw z#>)~$JI3~%Up- zjfH^)kQk~$`B}oYMjpn%P|}G|8bpH!Yj}82J5LWwF4ELkY6GKzc4!#2Ob&qJaMsMz zj*=-WQ*SJu3)25hRZQRyhC7eyM=HKmcn4bTFT?T$N&s2bf>L2;q6I z@JftL^BKnn0gAMfVku^LIfkdXQCQLy=+~~nl!#D4xo8*$8zg4|dFvMnD9>8xP2`$2H|5TAZ{kof=omS z1In0+CJeY4C}9(RHW?=^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&8|5 IhzV!^0`Q1CMgRZ+ literal 0 HcmV?d00001 diff --git a/.README.md.swp b/.README.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..42561e9159f8c3665ddebfb9d4488ac89eb4f7b9 GIT binary patch literal 16384 zcmeHOTaO$^6|RIkB!H41K*0vFD|UNkZ6`7-Sz+z9@fxpj*1NV43Z9zon(111ceSgk zXLf8tkcfCff`E7dL6aCr_$Kp-UC?+}G2kO=RP@SUpeov}9o9OZ$a9_e%M z^wi~?ug<0VRJ-3jzrMi_M+X=_uV?JwGk5nt^ra8p^v=5(v#A=+lc6Mn)#7DKh zw6v;Bl<8Px`?|fK8g|yCz2tP+8OlN$;nYYj3FDS@DGRGB6U)x#@zu4B<58aM8=<|? zGSD*cycnq5VCnF!+XoLUcd7r}o8HK8zis<@4b^sP8E6@38E6@38E6@38E6@38E6@J zaWde_o7w#k{pMQygZ1^M>#i@UzrV7+zU{i->#yylWuRrCWuRrCWuRrCWuRrCWuRrC zWuRrCWuRr?e~S}Z0OuVYN3-Bm#5qK|f2Dk;=|LgVC*5_Gr)&|^_MgDsh2VKN#Lt5W$Y_J7q}e-i`xLw>rUVh@EG*` zJn%W-v%rhvGlvgf%`!b!#gHdzFpx$TjvHZ=Q_}K*HawQb302_cjkU%QlTIck5<}>` zuL``7p$p5{ww2talFMCX9ZlR5NphMR+TIOH^xw?!f=K;>4D#<)=XkFrvs_p{tW+Y3 zSbF+XJ?2hxP{ci%HsV{UvS?j!slcP*y2vKHs#z^WF1a3fh6DSeNcdP~nQxNFfv7Ua zOKq{lx*-1NcaL-z`Q%7qs%r&0}5H~pc$v9QQt zEVIK-$0Aw#l9xu0RDzMnta5FjUt3H*+rH zSQ}~srD2x7VURM~u|3|O)bli>B+AIxX@mQMdS~)XN)e~QWl3sG59`>YdZdI`B{0MX zDw9E1yb=YScvYy&6<(LJc9BD#v4H#6<~BkU&=rC}BLk_Q!+2Dg!NjhYAlO_^oM3&h zk~9p(7A^~24O3o9lUFW80WUZ$o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Vpu2a>tK z7-(WD6w~ljz9vU9(`8OAY&FEOOnuJiD{=k=A{=Cf6DK@`b38ud5>8W$&iwH}s5)2v zD5XerPDdhCUZL_^ID0_}5#=SCnyM~M-Jz*G(E$q8j_L_Xsl7u_s#xJ`j<&wML^VBM z-HX_IIIhvw`obhC5cSaw&M;6ni=h=&?QyCT>i&`rDugd=qlAfy%=nsfq578*ihlKk z{#1Yp=6s0%4_|~Le_bhU3d>aeX%32dIDp%v^WVwYF#QQ_PSfEm3P^OgRQDO+*e0P$ T9dXga0-}WGt2%X&E8^^5RZv!* literal 0 HcmV?d00001 diff --git a/1 b/1 new file mode 100644 index 00000000..ba7cb3a7 --- /dev/null +++ b/1 @@ -0,0 +1,58 @@ +# Welcome to HashLips 👄 + +All the code in these repos was created and explained by HashLips on the main YouTube channel. + +To find out more please visit: + +[đŸ“ē YouTube](https://www.youtube.com/channel/UC1LV4_VQGBJHTJjEWUmy8nA) + +[👄 Discord](https://discord.com/invite/qh6MWhMJDN) + +[đŸ’Ŧ Telegram](https://t.me/hashlipsnft) + +[đŸĻ Twitter](https://twitter.com/hashlipsnft) + +[â„šī¸ Website](https://hashlips.online/HashLips) + +# generative-art-opensource +Create generative art by using the canvas api and node js, feel free to contribute to this repo with new ideas. + +# Project Setup +- install `node.js` on your local system (https://nodejs.org/en/) +- clone the repository to your local system `git@github.com:HashLips/generative-art-opensource.git` +- run `yarn install` to install dependencies + +# How to use +## Run the code +1. Run `node index.js` +2. Open the `./output` folder to find your generated images to use as NFTs, as well as the metadata to use for NFT marketplaces. + +## Adjust the provided configuration and resources +### Configuration file +The file `./input/config.js` contains the following properties that can be adjusted to your preference in order to change the behavior of the NFT generation procedure: +- width: - of your image in pixels. Default: `1000px` +- height: - of your image in pixels. Default: `1000px` +- dir: - where image parts are stored. Default: `./input` +- description: - of your generated NFT. Default: `This is an NFT made by the coolest generative code.` +- baseImageUri: - URL base to access your NFTs from. This will be used by platforms to find your image resource. This expects the image to be accessible by it's id like `${baseImageUri}/${id}`. +- startEditionFrom: - number (int) to start naming NFTs from. Default: `1` +- editionSize: - number (int) to end edition at. Default: `10` +- editionDnaPrefix: - value (number or string) that indicates which dna from an edition is used there. I.e. dna `0` from to independent batches in the same edition may differ, and can be differentiated using this. Default: `0` +- rarityWeights: - allows to provide rarity categories and how many of each type to include in an edition. Default: `1 super_rare, 4 rare, 5 original` +- layers: list of layers that should be used to render the image. See next section for detail. + +### Image layers +The image layers are different parts that make up a full image by overlaying on top of each other. E.g. in the example input content of this repository we start with the eyeball and layer features like the eye lids or iris on top to create the completed and unique eye, which we can then use as part of our NFT collection. +To ensure uniqueness, we want to add various features and multiple options for each of them in order to allow enough permutations for the amount of unique images we require. + +To start, copy the layers/features and their images in a flat hierarchy at a directory of your choice (by default we expect them in `./input/`). The features should contain options for each rarity that is provided via the config file. + +After adding the `layers`, adjust them accordingly in the `config.js` by providing the directory path, positioning and sizes. +Use the existing `addLayers` calls as guidance for how to add layers. This can either only use the name of the layer and will use default positioning (x=0, y=0) and sizes (width=configured width, height=configure height), or positioning and sizes can be provided for more flexibility. + +### Allowing different rarities for certain rarity/layer combinations +It is possible to provide a percentage at which e.g. a rare item would contain a rare vs. common part in a given layer. This can be done via the `addRarityPercentForLayer` that can be found in the `config.js` as well. +This allows for more fine grained control over how much randomness there should be during the generation process, and allows a combination of common and rare parts. + +# Development suggestions +- Preferably use VSCode with the prettifier plugin for a consistent coding style (or equivalent js formatting rules) diff --git a/README.md b/README.md index a82e1289..4329dcee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Welcome to HashLips 👄 +--------v6 Branch ------- +Opensource Contributing Important: There is a new repo for this code. [https://github.com/HashLips/hashlips_art_engine](https://github.com/HashLips/hashlips_art_engine)