bitgen 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/README.md +115 -79
  4. data/Rakefile +1 -1
  5. data/lib/bitgen.rb +12 -4
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d2da11669caadb65ebcb6af3a302c732af8b015b30c6c6ef8dc7d19db553b4d
4
- data.tar.gz: cac6c0f92e52cb2e8dda34d2d29e1f114bd4109704d1b55404145d4b9c4be318
3
+ metadata.gz: 02cf958fb6681cad6283d1face9ec2072ed49b27cb90d2bb32059699a0882c5d
4
+ data.tar.gz: dc7cfb96e82b7f16c7aa9ff7fcad31e84da8c0cc80dce037a874b1e3cc4c6a18
5
5
  SHA512:
6
- metadata.gz: a43a312e44c8a928b41d455ea68e42e86fb24a74ae2ca8bb52f559c93a1039379c075bbd823e059a264b9d463e407abd1ce1eae35fb55cbcad0f7ce7aa2bc09a
7
- data.tar.gz: d40be4d2466d90db4975550c8c4330884c72d6bf6a3d91d9265a6f094b30e8e55eb39755a524d69d729d6782515c14abfe2a3fee5feef2041c4ecc2ef1865c21
6
+ metadata.gz: 910e7cf281efd19756244e6641cef2be923079d5929abf1107181eede076bc340aed09a4838604ea37917f102f61b0da33bcfc7d9f3fd9113c784116f6d78fe5
7
+ data.tar.gz: 3c76e587ba026d2c076d38d2165d4886030978ce61c3de6e827562d73727105614b8d27c74f872bb400c08fdfd5b3b1cbf9e8a6ce376a34b8f67df25e33d5eb1
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.1.0 / 2023-07-30
1
+ ### 1.0.0 / 2023-07-31
2
2
  ### 0.0.1 / 2023-07-30
3
3
 
4
4
  * Everything is new. First release
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
- ### Collection №1 - 1000 Ordibots (32x32px)
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
- ![](i/bot1.png)
83
- ![](i/bot2.png)
84
- ![](i/bot3.png)
79
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot1.png)
80
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot2.png)
81
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot3.png)
85
82
 
86
83
  in 4x:
87
84
 
88
- ![](i/bot1@4x.png)
89
- ![](i/bot2@4x.png)
90
- ![](i/bot3@4x.png)
85
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot1@4x.png)
86
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot2@4x.png)
87
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/bot3@4x.png)
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 - face (7)
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
- 4 - belly (3)
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
- +---2_face
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
- \---4_belly
206
- 0_empty.png
207
- 0_empty@8x.png
208
- 1_chess.png
209
- 1_chess@8x.png
210
- 2_square.png
211
- 2_square@8x.png
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
- ### Collection №2 - 20 000 Blooming Flower (80x80px)
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
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet1.png)
237
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet2.png)
238
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet1a.png)
239
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet2a.png)
240
+
241
+ 4x
242
+
243
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet1@4x.png)
244
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet2@4x.png)
245
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet1a@4x.png)
246
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/pet2a@4x.png)
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
- ![](i/flower1.png)
271
- ![](i/flower2.png)
272
- ![](i/flower1a.png)
273
- ![](i/flower2a.png)
300
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower1.png)
301
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower2.png)
302
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower1a.png)
303
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower2a.png)
274
304
 
275
305
  in 4x:
276
306
 
277
- ![](i/flower1@4x.png)
278
- ![](i/flower2@4x.png)
279
- ![](i/flower1a@4x.png)
280
- ![](i/flower2a@4x.png)
307
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower1@4x.png)
308
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower2@4x.png)
309
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower1a@4x.png)
310
+ ![](https://github.com/ordbase/ordbase/raw/master/bitgen/i/flower2a@4x.png)
311
+
312
+
281
313
 
282
314
 
315
+ That's it. For more collections try:
283
316
 
284
- That's it for now.
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
@@ -3,7 +3,7 @@ require 'hoe'
3
3
 
4
4
  Hoe.spec 'bitgen' do
5
5
 
6
- self.version = '0.1.0' ## Pixelart::Module::Bitgen::VERSION
6
+ self.version = '1.0.0' ## Pixelart::Module::Bitgen::VERSION
7
7
 
8
8
 
9
9
  self.summary = "bitgen - bitcoin generative (inscription) image machinery incl. gen-brc721 & co"
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
- data['traits'].each do |category_name, h|
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
- cat = attributes[ category_name ] ||= {}
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
- img.zoom(8).save( path+"@8x.png" )
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: 0.1.0
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-30 00:00:00.000000000 Z
11
+ date: 2023-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart