bitgen 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/README.md +115 -79
- data/Rakefile +1 -1
- data/lib/bitgen.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02cf958fb6681cad6283d1face9ec2072ed49b27cb90d2bb32059699a0882c5d
|
4
|
+
data.tar.gz: dc7cfb96e82b7f16c7aa9ff7fcad31e84da8c0cc80dce037a874b1e3cc4c6a18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 910e7cf281efd19756244e6641cef2be923079d5929abf1107181eede076bc340aed09a4838604ea37917f102f61b0da33bcfc7d9f3fd9113c784116f6d78fe5
|
7
|
+
data.tar.gz: 3c76e587ba026d2c076d38d2165d4886030978ce61c3de6e827562d73727105614b8d27c74f872bb400c08fdfd5b3b1cbf9e8a6ce376a34b8f67df25e33d5eb1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ BUT yes, [Ordgen / ORC-721](https://github.com/ordbase/generative-orc-721) may b
|
|
28
28
|
Let's try some (historic) Gen BRC-721 collections...
|
29
29
|
|
30
30
|
|
31
|
-
|
31
|
+
#### Collection №1 - 1000 Ordibots (32×32px)
|
32
32
|
|
33
33
|
_The world's first gen-brc-721_
|
34
34
|
|
@@ -48,11 +48,10 @@ gen = Bitgen::Generator.read( './ordibots.json' )
|
|
48
48
|
bot = gen.generate( accessories: 'antenna',
|
49
49
|
body: 'gold-oval',
|
50
50
|
belly: 'chess',
|
51
|
-
face: 'happy'
|
51
|
+
face: 'happy'
|
52
52
|
)
|
53
53
|
|
54
54
|
bot.save( "./bot1.png" )
|
55
|
-
bot.zoom( 4 ).save( "./bot1@4x.png" )
|
56
55
|
|
57
56
|
|
58
57
|
bot = gen.generate( background: 'bitcoin-orange',
|
@@ -63,7 +62,6 @@ bot = gen.generate( background: 'bitcoin-orange',
|
|
63
62
|
)
|
64
63
|
|
65
64
|
bot.save( "./bot2.png" )
|
66
|
-
bot.zoom( 4 ).save( "./bot2@4x.png" )
|
67
65
|
|
68
66
|
|
69
67
|
bot = gen.generate( background: 'bitcoin-orange',
|
@@ -74,20 +72,19 @@ bot = gen.generate( background: 'bitcoin-orange',
|
|
74
72
|
)
|
75
73
|
|
76
74
|
bot.save( "./bot3.png" )
|
77
|
-
bot.zoom( 4 ).save( "./bot3@4x.png" )
|
78
75
|
```
|
79
76
|
|
80
77
|
resulting in:
|
81
78
|
|
82
|
-

|
83
|
-

|
84
|
-

|
79
|
+

|
80
|
+

|
81
|
+

|
85
82
|
|
86
83
|
in 4x:
|
87
84
|
|
88
|
-

|
89
|
-

|
90
|
-

|
85
|
+

|
86
|
+

|
87
|
+

|
91
88
|
|
92
89
|
|
93
90
|
If you wonder what categories and names can I use?
|
@@ -111,15 +108,7 @@ resulting in:
|
|
111
108
|
0 - antenna
|
112
109
|
1 - none
|
113
110
|
2 - rainbow
|
114
|
-
2 -
|
115
|
-
0 - happy
|
116
|
-
1 - neutral
|
117
|
-
2 - surprised
|
118
|
-
3 - unimpressed
|
119
|
-
4 - angry
|
120
|
-
5 - bored-green
|
121
|
-
6 - bored-red
|
122
|
-
3 - body (9)
|
111
|
+
2 - body (9)
|
123
112
|
0 - standard-triangular
|
124
113
|
1 - standard-square
|
125
114
|
2 - standard-oval
|
@@ -129,10 +118,18 @@ resulting in:
|
|
129
118
|
6 - black-and-white-triangular
|
130
119
|
7 - gold-square
|
131
120
|
8 - gold-triangular
|
132
|
-
|
121
|
+
3 - belly (3)
|
133
122
|
0 - empty
|
134
123
|
1 - chess
|
135
124
|
2 - square
|
125
|
+
4 - face (7)
|
126
|
+
0 - happy
|
127
|
+
1 - neutral
|
128
|
+
2 - surprised
|
129
|
+
3 - unimpressed
|
130
|
+
4 - angry
|
131
|
+
5 - bored-green
|
132
|
+
6 - bored-red
|
136
133
|
```
|
137
134
|
|
138
135
|
Now if you wonder what do these look in pixels?
|
@@ -150,70 +147,107 @@ resulting in:
|
|
150
147
|
/ordibots
|
151
148
|
+---0_background
|
152
149
|
| 0_blue.png
|
153
|
-
| 0_blue@8x.png
|
154
150
|
| 1_bitcoin-orange.png
|
155
|
-
| 1_bitcoin-orange@8x.png
|
156
151
|
| 2_brown.png
|
157
|
-
| 2_brown@8x.png
|
158
152
|
| 3_purple.png
|
159
|
-
| 3_purple@8x.png
|
160
153
|
|
|
161
154
|
+---1_accessories
|
162
155
|
| 0_antenna.png
|
163
|
-
| 0_antenna@8x.png
|
164
156
|
| 1_none.png
|
165
|
-
| 1_none@8x.png
|
166
157
|
| 2_rainbow.png
|
167
|
-
| 2_rainbow@8x.png
|
168
158
|
|
|
169
|
-
+---
|
170
|
-
| 0_happy.png
|
171
|
-
| 0_happy@8x.png
|
172
|
-
| 1_neutral.png
|
173
|
-
| 1_neutral@8x.png
|
174
|
-
| 2_surprised.png
|
175
|
-
| 2_surprised@8x.png
|
176
|
-
| 3_unimpressed.png
|
177
|
-
| 3_unimpressed@8x.png
|
178
|
-
| 4_angry.png
|
179
|
-
| 4_angry@8x.png
|
180
|
-
| 5_bored-green.png
|
181
|
-
| 5_bored-green@8x.png
|
182
|
-
| 6_bored-red.png
|
183
|
-
| 6_bored-red@8x.png
|
184
|
-
|
|
185
|
-
+---3_body
|
159
|
+
+---2_body
|
186
160
|
| 0_standard-triangular.png
|
187
|
-
| 0_standard-triangular@8x.png
|
188
161
|
| 1_standard-square.png
|
189
|
-
| 1_standard-square@8x.png
|
190
162
|
| 2_standard-oval.png
|
191
|
-
| 2_standard-oval@8x.png
|
192
163
|
| 3_gold-oval.png
|
193
|
-
| 3_gold-oval@8x.png
|
194
164
|
| 4_black-and-white-square.png
|
195
|
-
| 4_black-and-white-square@8x.png
|
196
165
|
| 5_black-and-white-oval.png
|
197
|
-
| 5_black-and-white-oval@8x.png
|
198
166
|
| 6_black-and-white-triangular.png
|
199
|
-
| 6_black-and-white-triangular@8x.png
|
200
167
|
| 7_gold-square.png
|
201
|
-
| 7_gold-square@8x.png
|
202
168
|
| 8_gold-triangular.png
|
203
|
-
| 8_gold-triangular@8x.png
|
204
169
|
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
170
|
+
+---3_belly
|
171
|
+
| 0_empty.png
|
172
|
+
| 1_chess.png
|
173
|
+
| 2_square.png
|
174
|
+
|
|
175
|
+
\---4_face
|
176
|
+
0_happy.png
|
177
|
+
1_neutral.png
|
178
|
+
2_surprised.png
|
179
|
+
3_unimpressed.png
|
180
|
+
4_angry.png
|
181
|
+
5_bored-green.png
|
182
|
+
6_bored-red.png
|
212
183
|
```
|
213
184
|
|
214
185
|
|
186
|
+
#### Collection №2 - 400 Satoshi's Pets (630×630px = 45×45px@14X)
|
187
|
+
|
188
|
+
_The world's second (?) gen-brc-721_
|
189
|
+
|
190
|
+
Find the deploy text @ [inscription no 9324087](https://ordinals.com/inscription/5a3488d19fec02c6629255a43f0615bfc1f4461d5087d6671a2222803966c871i0) - May 27, 2023 by Miek Brantovskii.
|
191
|
+
|
215
192
|
|
216
|
-
|
193
|
+
Let's generate some ulta-rare never-before-seen (do-it-yourself) satoshi's pets (cat, dog, mouse, rabbit, monkey).
|
194
|
+
|
195
|
+
``` ruby
|
196
|
+
require 'bitgen'
|
197
|
+
|
198
|
+
## step 1: read in the deploy text (incl the base64-encoded generative images)
|
199
|
+
gen = Bitgen::Generator.read( './satoshipets.json' )
|
200
|
+
|
201
|
+
## step 2: generate your images
|
202
|
+
pet = gen.generate( background: 'aube',
|
203
|
+
pets: 'monkey',
|
204
|
+
stuff: 'star',
|
205
|
+
eyes: 'normal'
|
206
|
+
)
|
207
|
+
|
208
|
+
pet.save( "./pet1.png" )
|
209
|
+
|
210
|
+
|
211
|
+
pet = gen.generate( background: 'twilight',
|
212
|
+
pets: 'rabbit',
|
213
|
+
stuff: 'rainbow',
|
214
|
+
eyes: 'mask'
|
215
|
+
)
|
216
|
+
|
217
|
+
pet.save( "./pet2.png" )
|
218
|
+
|
219
|
+
|
220
|
+
pet = gen.generate( pets: 'monkey',
|
221
|
+
eyes: 'normal'
|
222
|
+
)
|
223
|
+
|
224
|
+
pet.save( "./pet1a.png" )
|
225
|
+
|
226
|
+
|
227
|
+
pet = gen.generate( pets: 'rabbit',
|
228
|
+
eyes: 'mask'
|
229
|
+
)
|
230
|
+
|
231
|
+
pet.save( "./pet2a.png" )
|
232
|
+
```
|
233
|
+
|
234
|
+
resulting in:
|
235
|
+
|
236
|
+

|
237
|
+

|
238
|
+

|
239
|
+

|
240
|
+
|
241
|
+
4x
|
242
|
+
|
243
|
+

|
244
|
+

|
245
|
+

|
246
|
+

|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
#### Collection №3 - 20 000 Blooming Flower (80×80px)
|
217
251
|
|
218
252
|
Find the deploy text @ [inscription no 17707699](https://ordinals.com/inscription/1a1427e31c91566fe7fb47d7f5c1b2130bea31219a08e1de794d45512319ee61i0) - July 17, 2023.
|
219
253
|
|
@@ -231,57 +265,59 @@ flower = gen.generate( background: 'new-moon',
|
|
231
265
|
window: 'simple-yellow',
|
232
266
|
table: 'metal',
|
233
267
|
flowerpot: 'ceramics-red',
|
234
|
-
rose: 'bud-red'
|
268
|
+
rose: 'bud-red'
|
235
269
|
)
|
236
270
|
|
237
271
|
flower.save( "./flower1.png" )
|
238
|
-
flower.zoom( 4 ).save( "./flower1@4x.png" )
|
239
272
|
|
240
273
|
|
241
274
|
flower = gen.generate( background: 'autumn',
|
242
275
|
window: 'sliding-yellow',
|
243
276
|
table: 'wood',
|
244
277
|
flowerpot: 'ceramics-blue',
|
245
|
-
rose: 'bud-white'
|
278
|
+
rose: 'bud-white'
|
246
279
|
)
|
247
280
|
|
248
281
|
flower.save( "./flower2.png" )
|
249
|
-
flower.zoom( 4 ).save( "./flower2@4x.png" )
|
250
282
|
|
251
283
|
|
252
284
|
flower = gen.generate( flowerpot: 'ceramics-red',
|
253
|
-
rose: 'bud-red'
|
285
|
+
rose: 'bud-red'
|
254
286
|
)
|
255
287
|
|
256
288
|
flower.save( "./flower1a.png" )
|
257
|
-
flower.zoom( 4 ).save( "./flower1a@4x.png" )
|
258
289
|
|
259
290
|
|
260
291
|
flower = gen.generate( flowerpot: 'ceramics-blue',
|
261
|
-
rose: 'bud-white'
|
292
|
+
rose: 'bud-white'
|
262
293
|
)
|
263
294
|
|
264
295
|
flower.save( "./flower2a.png" )
|
265
|
-
flower.zoom( 4 ).save( "./flower2a@4x.png" )
|
266
296
|
```
|
267
297
|
|
268
298
|
resulting in:
|
269
299
|
|
270
|
-

|
271
|
-

|
272
|
-

|
273
|
-

|
300
|
+

|
301
|
+

|
302
|
+

|
303
|
+

|
274
304
|
|
275
305
|
in 4x:
|
276
306
|
|
277
|
-

|
278
|
-

|
279
|
-

|
280
|
-

|
307
|
+

|
308
|
+

|
309
|
+

|
310
|
+

|
311
|
+
|
312
|
+
|
281
313
|
|
282
314
|
|
315
|
+
That's it. For more collections try:
|
283
316
|
|
284
|
-
|
317
|
+
- 1000 Ordi Bot Mrs (32×32) @ [inscribe no. 9893590](https://ordinals.com/inscription/fd0d94695fc30af6238732c2b71aa4330511c5d2dd0ace2da05660c2ad57076di0) - May 29th, 2023 by Kelvin Liang
|
318
|
+
- 4210 (GBRC721) Bit Punks (24×24) @ [inscribe no. 9950751](https://ordinals.com/inscription/c3915284759eaba761f6e5acf64b50e1089fe62448b595f61a40407d71bfb85ei0) - May 29th, 2023
|
319
|
+
- 690 Ordinals Egg (60×60) @ [inscribe no. 10265255](https://ordinals.com/inscription/15e0a8e0a6adde4388f14d6385db7ac63d55acb1c5a5b67aa4f8de3d5ad5dacci0) - May 31st, 2023
|
320
|
+
- 10 000 Unemployed Artist (24×24) @ [inscribe no. 11673452](https://ordinals.com/inscription/c11e21e4ac155b88d8cc4cb7e11d8c4f66112e95cac04c4cb14e9361d93aac16i0) - June 13th, 2023
|
285
321
|
|
286
322
|
|
287
323
|
|
data/Rakefile
CHANGED
data/lib/bitgen.rb
CHANGED
@@ -9,13 +9,17 @@ class Catalog ## change/rename to Spritesheet / Atlas / Deploy or such - why?
|
|
9
9
|
# pp data
|
10
10
|
|
11
11
|
meta = {
|
12
|
-
'slug' => data['slug'],
|
12
|
+
'slug' => data['slug'].downcase, ## note: always downcase slug for now (e.g. OrdinalsEgg => ordinalsegg)
|
13
13
|
'name' => data['name'],
|
14
14
|
'dim' => data['dim']
|
15
15
|
}
|
16
16
|
|
17
17
|
attributes = {}
|
18
|
-
|
18
|
+
|
19
|
+
## note: use/access via trait_types array
|
20
|
+
## for (restoring insertion) order!!!
|
21
|
+
data['trait_types'].each do |category_name|
|
22
|
+
h = data['traits'][category_name]
|
19
23
|
puts "==> #{category_name} - #{h.size} record(s)..."
|
20
24
|
|
21
25
|
h.each_with_index do |(name, h), i|
|
@@ -23,7 +27,9 @@ class Catalog ## change/rename to Spritesheet / Atlas / Deploy or such - why?
|
|
23
27
|
|
24
28
|
img = Image.parse_base64( h['base64'] )
|
25
29
|
|
26
|
-
|
30
|
+
## note: always downcase category_name for now
|
31
|
+
## (e.g. Background => background in OrdinalsEgg for example)
|
32
|
+
cat = attributes[ category_name.downcase ] ||= {}
|
27
33
|
cat[ name ] = img
|
28
34
|
end
|
29
35
|
end
|
@@ -71,7 +77,9 @@ class Catalog ## change/rename to Spritesheet / Atlas / Deploy or such - why?
|
|
71
77
|
puts path
|
72
78
|
|
73
79
|
img.save( path+".png" )
|
74
|
-
|
80
|
+
## note - only auto-add zoom if width < 100px
|
81
|
+
## e.g. sathoshi's pet is 630px
|
82
|
+
img.zoom(8).save( path+"@8x.png" ) if img.width < 100
|
75
83
|
end
|
76
84
|
end
|
77
85
|
end # method export
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|