cryptopunks 1.2.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8f5a03075399de98c5456fd8c74bcd84c2bebea84b033131351c737dd1934ba
4
- data.tar.gz: cb75041e34f7104b4e19ab9913a66d3383273299f0a2bec10b53d2c6d428f4f0
3
+ metadata.gz: 3d5d23ce2a1fab0409c2c0e673aba9beeede74e54bb63eb0099d101d818b0911
4
+ data.tar.gz: fa35f796d658dcccd75b61ed156c63a60530c3a43b9117bc8607b7b297736559
5
5
  SHA512:
6
- metadata.gz: 258ce6be66ad8a06dae14aeb916e620549e50e2dc82a3d96964dbd31e7766df5205b89e630cf3c703b2dbbc52d0e14c4314751447e200ceab47fc7d8bbc81891
7
- data.tar.gz: c5d5556a2a644a25431f666fb46aa667c0460a721e379b43e17284e4400cb3b515e34d10fa28f2105dd0b45ea5c2bb039518bd45cf59aa2e1da8e98be455871e
6
+ metadata.gz: cad3b33c1b0ddea2bc64f98ff14c4e8d3ffac2d541026d4b473bfbf3f99a97dd29157e5d424bcdff27f59748fa75ae6910c06ba6366d6e69fa8210bbacdf75a8
7
+ data.tar.gz: 1b08e99c346d5f14b6f7c70325a253f79f2d02d558039a617367181e96c52a8ee7731491f84081b903cf001f48a6449c4fdb01403b9aad12020cf231aaef8dc8
data/Manifest.txt CHANGED
@@ -4,9 +4,18 @@ README.md
4
4
  Rakefile
5
5
  bin/cryptopunk
6
6
  bin/punk
7
+ config/spritesheet.csv
8
+ config/spritesheet.png
7
9
  lib/cryptopunks.rb
8
10
  lib/cryptopunks/attributes.rb
11
+ lib/cryptopunks/colors.rb
9
12
  lib/cryptopunks/composite.rb
13
+ lib/cryptopunks/contract/punksdata-assets.rb
14
+ lib/cryptopunks/contract/punksdata-contract.rb
15
+ lib/cryptopunks/contract/punksdata-meta.rb
10
16
  lib/cryptopunks/dataset.rb
17
+ lib/cryptopunks/generator.rb
18
+ lib/cryptopunks/image.rb
11
19
  lib/cryptopunks/structs.rb
20
+ lib/cryptopunks/tool.rb
12
21
  lib/cryptopunks/version.rb
data/README.md CHANGED
@@ -30,6 +30,7 @@ Usage: cryptopunk [options] IDs
30
30
  -z, --zoom=ZOOM Zoom factor x2, x4, x8, etc. (default: 1)
31
31
  -d, --dir=DIR Output directory (default: .)
32
32
  -f, --file=FILE True Official Genuine CryptoPunks™ composite image (default: ./punks.png)
33
+ --offset=NUM Start counting at offset (default: 0)
33
34
  -h, --help Prints this help
34
35
  ```
35
36
 
@@ -222,10 +223,6 @@ And so on.
222
223
 
223
224
 
224
225
 
225
-
226
-
227
-
228
-
229
226
  ## Usage in Your Scripts
230
227
 
231
228
 
data/Rakefile CHANGED
@@ -20,6 +20,7 @@ Hoe.spec 'cryptopunks' do
20
20
  self.extra_deps = [
21
21
  ['pixelart'],
22
22
  ['csvreader'],
23
+ ['gli'],
23
24
  ]
24
25
 
25
26
  self.licenses = ['Public Domain']
@@ -0,0 +1,237 @@
1
+ id, name, gender, type, more_names
2
+ 0, Male 1, m, Archetype - Human,
3
+ 1, Male 2, m, Archetype - Human,
4
+ 2, Male 3, m, Archetype - Human,
5
+ 3, Male 4, m, Archetype - Human,
6
+ 4, Female 1, f, Archetype - Human,
7
+ 5, Female 2, f, Archetype - Human,
8
+ 6, Female 3, f, Archetype - Human,
9
+ 7, Female 4, f, Archetype - Human,
10
+ 8, Zombie, m, Archetype - Zombie,
11
+ 9, Zombie Female, f, Archetype - Zombie,
12
+ 10, Ape, m, Archetype - Ape,
13
+ 11, Ape Female, f, Archetype - Ape,
14
+ 12, Alien, m, Archetype - Alien,
15
+ 13, Alien Female, f, Archetype - Alien,
16
+ 14, Demon, m, Archetype - Demon,
17
+ 15, Demon Female, f, Archetype - Demon,
18
+ 16, Mummy, m, Archetype - Mummy,
19
+ 17, Mummy Female, f, Archetype - Mummy,
20
+ 18, Orc, m, Archetype - Orc,
21
+ 19, Orc Female, f, Archetype - Orc,
22
+ 20, Robot, m, Archetype - Robot,
23
+ 21, Robot Female, f, Archetype - Robot,
24
+ 22, Skeleton, m, Archetype - Skeleton,
25
+ 23, Skeleton Female, f, Archetype - Skeleton,
26
+ 24, Vampire, m, Archetype - Vampire,
27
+ 25, Vampire Female, f, Archetype - Vampire,
28
+ 26, Zombie (Ape), m, Archetype - Zombie,
29
+ 27, Alien (Ape), m, Archetype - Alien,
30
+ 28, Alien 0°, m, Archetype - Alien,
31
+ 29, Alien 30°, m, Archetype - Alien,
32
+ 30, Alien 60°, m, Archetype - Alien,
33
+ 31, Alien 90°, m, Archetype - Alien,
34
+ 32, Alien 120°, m, Archetype - Alien,
35
+ 33, Alien 150°, m, Archetype - Alien,
36
+ 34, Alien 180°, m, Archetype - Alien,
37
+ 35, Alien 210°, m, Archetype - Alien,
38
+ 36, Alien 240°, m, Archetype - Alien,
39
+ 37, Alien 270°, m, Archetype - Alien,
40
+ 38, Alien 300°, m, Archetype - Alien,
41
+ 39, Alien 330°, m, Archetype - Alien,
42
+ 40, Alien (Ape) 0°, m, Archetype - Alien,
43
+ 41, Alien (Ape) 30°, m, Archetype - Alien,
44
+ 42, Alien (Ape) 60°, m, Archetype - Alien,
45
+ 43, Alien (Ape) 90°, m, Archetype - Alien,
46
+ 44, Alien (Ape) 120°, m, Archetype - Alien,
47
+ 45, Alien (Ape) 150°, m, Archetype - Alien,
48
+ 46, Alien (Ape) 180°, m, Archetype - Alien,
49
+ 47, Alien (Ape) 210°, m, Archetype - Alien,
50
+ 48, Alien (Ape) 240°, m, Archetype - Alien,
51
+ 49, Alien (Ape) 270°, m, Archetype - Alien,
52
+ 50, Alien (Ape) 300°, m, Archetype - Alien,
53
+ 51, Alien (Ape) 330°, m, Archetype - Alien,
54
+ 52, Alien Female 0°, f, Archetype - Alien,
55
+ 53, Alien Female 30°, f, Archetype - Alien,
56
+ 54, Alien Female 60°, f, Archetype - Alien,
57
+ 55, Alien Female 90°, f, Archetype - Alien,
58
+ 56, Alien Female 120°, f, Archetype - Alien,
59
+ 57, Alien Female 150°, f, Archetype - Alien,
60
+ 58, Alien Female 180°, f, Archetype - Alien,
61
+ 59, Alien Female 210°, f, Archetype - Alien,
62
+ 60, Alien Female 240°, f, Archetype - Alien,
63
+ 61, Alien Female 270°, f, Archetype - Alien,
64
+ 62, Alien Female 300°, f, Archetype - Alien,
65
+ 63, Alien Female 330°, f, Archetype - Alien,
66
+ 64, 3D Glasses, m, Attribute,
67
+ 65, 3D Glasses, f, Attribute,
68
+ 66, Bandana, m, Attribute,
69
+ 67, Bandana, f, Attribute,
70
+ 68, Beanie, m, Attribute,
71
+ 69, Beanie, f, Attribute,
72
+ 70, Big Beard, m, Attribute,
73
+ 71, Big Shades, m, Attribute,
74
+ 72, Big Shades, f, Attribute,
75
+ 73, Black Lipstick, f, Attribute,
76
+ 74, Blonde Bob, f, Attribute,
77
+ 75, Blonde Short, f, Attribute,
78
+ 76, Blue Eye Shadow, f, Attribute,
79
+ 77, Buck Teeth, m, Attribute,
80
+ 78, Cap, m, Attribute,
81
+ 79, Cap, f, Attribute,
82
+ 80, Cap Forward, m, Attribute,
83
+ 81, Cap Forward, f, Attribute,
84
+ 82, Chinstrap, m, Attribute,
85
+ 83, Choker, f, Attribute,
86
+ 84, Cigarette, m, Attribute,
87
+ 85, Cigarette, f, Attribute,
88
+ 86, Classic Shades, m, Attribute,
89
+ 87, Classic Shades, f, Attribute,
90
+ 88, Clown Eyes Blue, m, Attribute,
91
+ 89, Clown Eyes Blue, f, Attribute,
92
+ 90, Clown Eyes Green, m, Attribute,
93
+ 91, Clown Eyes Green, f, Attribute,
94
+ 92, Clown Hair Green, m, Attribute,
95
+ 93, Clown Hair Green, f, Attribute,
96
+ 94, Clown Nose, m, Attribute,
97
+ 95, Clown Nose, f, Attribute,
98
+ 96, Cowboy Hat, m, Attribute,
99
+ 97, Cowboy Hat, f, Attribute,
100
+ 98, Crazy Hair, m, Attribute,
101
+ 99, Crazy Hair, f, Attribute,
102
+ 100, Dark Hair, f, Attribute,
103
+ 101, Do-rag, m, Attribute,
104
+ 102, Do-rag, f, Attribute,
105
+ 103, Earring, m, Attribute,
106
+ 104, Earring, f, Attribute,
107
+ 105, Eye Mask, m, Attribute,
108
+ 106, Eye Mask, f, Attribute,
109
+ 107, Eye Patch, m, Attribute,
110
+ 108, Eye Patch, f, Attribute,
111
+ 109, Fedora, m, Attribute,
112
+ 110, Fedora, f, Attribute,
113
+ 111, Front Beard, m, Attribute,
114
+ 112, Front Beard Dark, m, Attribute,
115
+ 113, Frown, m, Attribute,
116
+ 114, Frumpy Hair, m, Attribute,
117
+ 115, Frumpy Hair, f, Attribute,
118
+ 116, Green Eye Shadow, f, Attribute,
119
+ 117, Goat, m, Attribute,
120
+ 118, Gold Chain, m, Attribute,
121
+ 119, Gold Chain, f, Attribute,
122
+ 120, Half Shaved, f, Attribute,
123
+ 121, Handlebars, m, Attribute,
124
+ 122, Headband, m, Attribute,
125
+ 123, Headband, f, Attribute,
126
+ 124, Hoodie, m, Attribute,
127
+ 125, Hoodie, f, Attribute,
128
+ 126, Horned Rim Glasses, m, Attribute,
129
+ 127, Horned Rim Glasses, f, Attribute,
130
+ 128, Hot Lipstick, f, Attribute,
131
+ 129, Knitted Cap, m, Attribute,
132
+ 130, Knitted Cap, f, Attribute,
133
+ 131, Luxurious Beard, m, Attribute,
134
+ 132, Medical Mask, m, Attribute,
135
+ 133, Medical Mask, f, Attribute,
136
+ 134, Messy Hair, m, Attribute,
137
+ 135, Messy Hair, f, Attribute,
138
+ 136, Mohawk, m, Attribute,
139
+ 137, Mohawk, f, Attribute,
140
+ 138, Mohawk Dark, m, Attribute,
141
+ 139, Mohawk Dark, f, Attribute,
142
+ 140, Mohawk Thin, m, Attribute,
143
+ 141, Mohawk Thin, f, Attribute,
144
+ 142, Mole, m, Attribute,
145
+ 143, Mole, f, Attribute,
146
+ 144, Mustache, m, Attribute,
147
+ 145, Muttonchops, m, Attribute,
148
+ 146, Nerd Glasses, m, Attribute,
149
+ 147, Nerd Glasses, f, Attribute,
150
+ 148, Normal Beard, m, Attribute,
151
+ 149, Normal Beard Black, m, Attribute,
152
+ 150, Orange Side, f, Attribute,
153
+ 151, Peak Spike, m, Attribute,
154
+ 152, Pigtails, f, Attribute,
155
+ 153, Pilot Helmet, f, Attribute,
156
+ 154, Pink with Hat, f, Attribute,
157
+ 155, Pipe, m, Attribute,
158
+ 156, Pipe, f, Attribute,
159
+ 157, Police Cap, m, Attribute,
160
+ 158, Police Cap, f, Attribute,
161
+ 159, Purple Eye Shadow, f, Attribute,
162
+ 160, Purple Hair, m, Attribute,
163
+ 161, Purple Hair, f, Attribute,
164
+ 162, Purple Lipstick, f, Attribute,
165
+ 163, Red Mohawk, f, Attribute,
166
+ 164, Regular Shades, m, Attribute,
167
+ 165, Regular Shades, f, Attribute,
168
+ 166, Rosy Cheeks, m, Attribute,
169
+ 167, Rosy Cheeks, f, Attribute,
170
+ 168, Shadow Beard, m, Attribute,
171
+ 169, Shaved Head, m, Attribute,
172
+ 170, Shaved Head, f, Attribute,
173
+ 171, Silver Chain, m, Attribute,
174
+ 172, Silver Chain, f, Attribute,
175
+ 173, Small Shades, m, Attribute,
176
+ 174, Small Shades, f, Attribute,
177
+ 175, Smile, m, Attribute,
178
+ 176, Spots, m, Attribute,
179
+ 177, Spots, f, Attribute,
180
+ 178, Straight Hair, f, Attribute,
181
+ 179, Straight Hair Blonde, f, Attribute,
182
+ 180, Straight Hair Dark, f, Attribute,
183
+ 181, Stringy Hair, m, Attribute,
184
+ 182, Stringy Hair, f, Attribute,
185
+ 183, Tassle Hat, f, Attribute,
186
+ 184, Tiara, f, Attribute,
187
+ 185, Top Hat, m, Attribute,
188
+ 186, Top Hat, f, Attribute,
189
+ 187, Vampire Hair, m, Attribute,
190
+ 188, Vape, m, Attribute,
191
+ 189, Vape, f, Attribute,
192
+ 190, VR, m, Attribute,
193
+ 191, VR, f, Attribute,
194
+ 192, Welding Goggles, f, Attribute,
195
+ 193, Wild Blonde, f, Attribute,
196
+ 194, Wild Hair, m, Attribute,
197
+ 195, Wild Hair, f, Attribute,
198
+ 196, Wild White Hair, f, Attribute,
199
+ 197, Bear Hood, m, Attribute,
200
+ 198, Bear Hood, f, Attribute,
201
+ 199, Birthday Hat, m, Attribute,
202
+ 200, Birthday Hat, f, Attribute,
203
+ 201, Bow, f, Attribute,
204
+ 202, Cigar, m, Attribute,
205
+ 203, Cigar, f, Attribute,
206
+ 204, Crown, m, Attribute,
207
+ 205, Crown, f, Attribute,
208
+ 206, Flowers, f, Attribute,
209
+ 207, Frog Hood, m, Attribute,
210
+ 208, Frog Hood, f, Attribute,
211
+ 209, Gold Diamond Necklace, m, Attribute,
212
+ 210, Gold Diamond Necklace, f, Attribute,
213
+ 211, Heart Shades, m, Attribute,
214
+ 212, Heart Shades, f, Attribute,
215
+ 213, Jester Hat, m, Attribute,
216
+ 214, Jester Hat, f, Attribute,
217
+ 215, Laser Eyes, m, Attribute,
218
+ 216, Laser Eyes Gold, m, Attribute,
219
+ 217, Pink Lipstick, f, Attribute,
220
+ 218, Red Lipstick, f, Attribute,
221
+ 219, Santa Hat, m, Attribute,
222
+ 220, Santa Hat, f, Attribute,
223
+ 221, Silver Earring, m, Attribute,
224
+ 222, Silver Earring, f, Attribute,
225
+ 223, Ski Googles, m, Attribute,
226
+ 224, Ski Googles, f, Attribute,
227
+ 225, Sombrero, m, Attribute,
228
+ 226, Sombrero, f, Attribute,
229
+ 227, Sun Hat, m, Attribute,
230
+ 228, Sun Hat, f, Attribute,
231
+ 229, Superhero Tiara, f, Attribute,
232
+ 230, Tears, m, Attribute,
233
+ 231, Tears, f, Attribute,
234
+ 232, Viking Helmet, m, Attribute,
235
+ 233, Viking Helmet, f, Attribute,
236
+ 234, Winter Hat, m, Attribute,
237
+ 235, Winter Hat, f, Attribute,
Binary file
@@ -0,0 +1,162 @@
1
+
2
+ ROBOT_COLORS = [
3
+ '000000', # color 1 - BLACK
4
+ '535353', # color 2 - BASE 2 (DARKER)
5
+ 'A4A4A4', # color 3 - BASE 1
6
+ 'A9F7FF', # color 4 - BASE 3 (LIGHTER) - eyes
7
+ ]
8
+
9
+ VAMPIRE_COLORS = [
10
+ '000000', # color 1 - BLACK
11
+ '131313', # color 2 - BASE 4 (DARKEST)
12
+ '535353', # color 3 - BASE 3 (DARKERER) - eyes
13
+ 'A4A4A4', # color 4 - BASE 2 (DARKER) - eyes
14
+ 'E0E0E0', # color 5 - BASE 1
15
+ 'F6000B', # color 6 - BASE 5 - teeth - red
16
+ ]
17
+
18
+ MUMMY_COLORS = [
19
+ '000000', # color 1 - BLACK
20
+ '1F1A15', # color 2 - BASE 5 (DARKEST)
21
+ '2A231C', # color 3 - BASE 4 (DARKERERER)
22
+ '5F5147', # color 4 - BASE 3 (DARKERER)
23
+ '927B6A', # color 5 - BASE 2 (DARKER)
24
+ 'D9B599', # color 6 - BASE 1
25
+ 'F6000B', # color 7 - BASE 6 - eyes - red
26
+ ]
27
+
28
+ ORC_COLORS = [
29
+ '000000', # color 1 - BLACK
30
+ '171a08', # color 2 - BASE 3 (DARKEST)
31
+ '333F0C', # color 3 - BASE 2 (DARKER)
32
+ '50650E', # color 4 - BASE 1
33
+ 'FFFFFF', # color 5 - BASE 4 - white
34
+ ]
35
+
36
+ SKELETON_COLORS = [
37
+ '000000', # color 1 - BLACK
38
+ 'e0e0e0', # color 2 - BASE 1
39
+ ]
40
+
41
+ DEMON_COLORS = [
42
+ '000000', # color 1 - BLACK
43
+ '390102', # color 2 - BASE 3 (DARKEST) - eyes
44
+ '630006', # color 3 - BASE 2 (DARKER) - eyes
45
+ '850008', # color 4 - BASE 1
46
+ ]
47
+
48
+ ZOMBIE_COLORS = [
49
+ '000000', # color 1 - BLACK
50
+ '5e7253', # color 2 - BASE 2 (DARKER)
51
+ '7da269', # color 3 - BASE 1
52
+ 'ff0000', # color 4 - BASE 3 - red eye
53
+ '9bbc88', # color 5 - BASE 4 (LIGHTER)
54
+ '4a010d', # color 6 - BASE 5 - mouth (female only)
55
+ ]
56
+
57
+ APE_COLORS = [
58
+ '000000', # color 1 - BLACK
59
+ '352410', # color 2 - BASE 3 (DARKEST)
60
+ '6a563f', # color 3 - BASE 2 (DARKER) - eyes
61
+ '856f56', # color 4 - BASE 1
62
+ 'a98c6b', # color 5 - BASE 4 (LIGHTER) - eyes
63
+ ]
64
+
65
+ ALIEN_COLORS = [
66
+ '000000', # color 1 - BLACK
67
+ '75bdbd', # color 2 - BASE 3 (DARKEST)
68
+ '9be0e0', # color 3 - BASE 2 (DARKER)
69
+ 'c8fbfb', # color 4 - BASE 1
70
+ ]
71
+
72
+
73
+ HUMAN_LIGHTER_BASE1 = 'ead9d9' # rgb(234 217 217) - hsl( 0° 29% 88%)
74
+ HUMAN_LIGHTER_BASE2 = 'c9b2b2' # rgb(201 178 178) - hsl( 0° 18% 74%) - eyes
75
+ HUMAN_LIGHTER_BASE3 = 'a58d8d' # rgb(165 141 141) - hsl( 0° 12% 60%) - eyes
76
+ HUMAN_LIGHTER_BASE4 = 'ffffff' # rgb(255 255 255) - hsl( 0° 0% 100%) -- white
77
+ HUMAN_LIGHTER_BASE5 = '711010' # rgb(113 16 16) - hsl( 0° 75% 25%) - mouth
78
+
79
+ HUMAN_LIGHT_BASE1 = 'dbb180' # rgb(219 177 128) - hsl( 32° 56% 68%)
80
+ HUMAN_LIGHT_BASE2 = 'd29d60' # rgb(210 157 96) - hsl( 32° 56% 60%) - eyes
81
+ HUMAN_LIGHT_BASE3 = 'a66e2c' # rgb(166 110 44) - hsl( 32° 58% 41%) - eyes
82
+ HUMAN_LIGHT_BASE4 = 'e7cba9' # rgb(231 203 169) - hsl( 33° 56% 78%)
83
+ HUMAN_LIGHT_BASE5 = '711010' # rgb(113 16 16) - hsl( 0° 75% 25%) - mouth
84
+
85
+ HUMAN_DARK_BASE1 = 'ae8b61' # rgb(174 139 97) - hsl( 33° 32% 53%)
86
+ HUMAN_DARK_BASE2 = 'a77c47' # rgb(167 124 71) - hsl( 33° 40% 47%) - eyes
87
+ HUMAN_DARK_BASE3 = '86581e' # rgb(134 88 30) - hsl( 33° 63% 32%) - eyes
88
+ HUMAN_DARK_BASE4 = 'b69f82' # rgb(182 159 130) - hsl( 33° 26% 61%)
89
+ HUMAN_DARK_BASE5 = '5f1d09' # rgb( 95 29 9) - hsl( 14° 83% 20%) - mouth
90
+
91
+ HUMAN_DARKER_BASE1 = '713f1d' # rgb(113 63 29) - hsl( 24° 59% 28%)
92
+ HUMAN_DARKER_BASE2 = '723709' # rgb(114 55 9) - hsl( 26° 85% 24%) - eyes
93
+ HUMAN_DARKER_BASE3 = '562600' # rgb( 86 38 0) - hsl( 27° 100% 17%) - eyes
94
+ HUMAN_DARKER_BASE4 = '8b532c' # rgb(139 83 44) - hsl( 25° 52% 36%)
95
+ HUMAN_DARKER_BASE5 = '4a1201' # rgb( 74 18 1) - hsl( 14° 97% 15%) - mouth
96
+
97
+
98
+ HUMAN_COLORS_LIGHT = [ ## todo/check: change to HUMAN_LIGHT_COLORS???
99
+ '000000', # color 1 - BLACK
100
+ HUMAN_LIGHT_BASE3, # color 2 - BASE 3 (DARKEST) - eyes
101
+ HUMAN_LIGHT_BASE2, # color 3 - BASE 2 (DARKER) - eyes
102
+ HUMAN_LIGHT_BASE1, # color 4 - BASE 1
103
+ HUMAN_LIGHT_BASE4, # color 5 - BASE 4
104
+ HUMAN_LIGHT_BASE5, # color 6 - BASE 5 - mouth (femaly only)
105
+ ]
106
+
107
+ HUMAN_COLORS_LIGHTER = [ ## todo/check: change to HUMAN_LIGHTER_COLORS?? or add alias - why? why not?
108
+ '000000', # color 1 - BLACK
109
+ HUMAN_LIGHTER_BASE3,
110
+ HUMAN_LIGHTER_BASE2,
111
+ HUMAN_LIGHTER_BASE1,
112
+ HUMAN_LIGHTER_BASE4,
113
+ HUMAN_LIGHTER_BASE5,
114
+ ]
115
+
116
+ HUMAN_COLORS_DARK = [
117
+ '000000', # color 1 - BLACK
118
+ HUMAN_DARK_BASE3,
119
+ HUMAN_DARK_BASE2,
120
+ HUMAN_DARK_BASE1,
121
+ HUMAN_DARK_BASE4,
122
+ HUMAN_DARK_BASE5,
123
+ ]
124
+
125
+ HUMAN_COLORS_DARKER = [
126
+ '000000', # color 1 - BLACK
127
+ HUMAN_DARKER_BASE3,
128
+ HUMAN_DARKER_BASE2,
129
+ HUMAN_DARKER_BASE1,
130
+ HUMAN_DARKER_BASE4,
131
+ HUMAN_DARKER_BASE5,
132
+ ]
133
+
134
+
135
+ HUMAN_COLORS = {
136
+ 'light' => HUMAN_COLORS_LIGHT,
137
+ 'lighter' => HUMAN_COLORS_LIGHTER,
138
+ 'dark' => HUMAN_COLORS_DARK,
139
+ 'darker' => HUMAN_COLORS_DARKER,
140
+ }
141
+
142
+
143
+
144
+ ### todo/check:
145
+ ## use a different name other than the "generic" COLORS - why? why not?
146
+
147
+ COLORS = {
148
+ ## original series
149
+ 'human' => HUMAN_COLORS,
150
+ 'zombie' => ZOMBIE_COLORS,
151
+ 'ape' => APE_COLORS,
152
+ 'alien' => ALIEN_COLORS,
153
+ ## more series
154
+ 'vampire' => VAMPIRE_COLORS,
155
+ 'mummy' => MUMMY_COLORS,
156
+ 'orc' => ORC_COLORS,
157
+ 'skeleton' => SKELETON_COLORS,
158
+ 'demon' => DEMON_COLORS,
159
+ 'robot' => ROBOT_COLORS,
160
+ }
161
+
162
+
@@ -1,62 +1,38 @@
1
1
  module Cryptopunks
2
- class Image
3
- class Composite ## nest Composite inside Image - why? why not?
2
+ ## note: was Image::Composite
3
+ class ImageComposite < Pixelart::ImageComposite
4
4
 
5
+ PUNK_HASH = 'ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b'
5
6
 
6
- def self.read( path='./punks.png' )
7
- data = File.open( path, 'rb' ) { |f| f.read }
8
- new( data )
7
+ def self.sha256( data )
8
+ ## todo/check: or just use Digest::SHA256.hexdigest - why? why not?
9
+ Digest::SHA256.digest( data ).unpack( 'H*' )[0]
9
10
  end
10
11
 
11
12
 
12
13
  PUNK_HEIGHT = 24
13
14
  PUNK_WIDTH = 24
14
15
 
15
- PUNK_HASH = 'ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b'
16
-
17
-
18
- def initialize( data )
19
- @punks = ChunkyPNG::Image.from_blob( data )
20
- puts " #{@punks.height}x#{@punks.width} (height x width)"
21
-
22
- @punk_rows = @punks.width / PUNK_WIDTH ## e.g. 2400/24 = 100
23
- @punk_cols = @punks.height / PUNK_HEIGHT ## e.g. 2400/24 = 100
24
- @punk_count = @punk_rows * @punk_cols ## ## 10000 = 100x100 (2400x2400 pixel)
16
+ def self.read( path='./punks.png', width: PUNK_WIDTH, height: PUNK_HEIGHT )
17
+ data = File.open( path, 'rb' ) { |f| f.read }
25
18
 
26
- ## check sha256 checksum
27
- @hexdigest = sha256( data )
28
- if original?
29
- puts " >#{@hexdigest}< SHA256 hash matching"
19
+ hexdigest = sha256( data ) ## check sha256 checksum
20
+ if hexdigest == PUNK_HASH
21
+ puts " >#{hexdigest}< SHA256 hash matching"
30
22
  puts " ✓ True Official Genuine CryptoPunks™ verified"
23
+ else
24
+ puts " ✓ True Official Genuine Yes, You Can! Punks Not Dead™ verified"
31
25
  end
32
- end
33
26
 
34
-
35
- def sha256( data )
36
- ## todo/check: or just use Digest::SHA256.hexdigest - why? why not?
37
- Digest::SHA256.digest( data ).unpack( 'H*' )[0]
27
+ img = ChunkyPNG::Image.from_blob( data )
28
+ new( img, width: width, height: height )
38
29
  end
39
30
 
40
31
 
41
- def hexdigest() @hexdigest end
42
-
43
- def verify?() @hexdigest == PUNK_HASH; end
44
- alias_method :genuine?, :verify?
45
- alias_method :original?, :verify?
46
-
47
-
48
-
49
- def size() @punk_count; end
50
-
51
-
52
- def punk( index )
53
- y, x = index.divmod( @punk_rows )
54
- img = @punks.crop( x*PUNK_WIDTH, y*PUNK_HEIGHT, PUNK_WIDTH, PUNK_HEIGHT )
55
- Pixelart::Image.new( img.width, img.height, img ) ## wrap in pixelart image
32
+ def initialize( *args, width: PUNK_WIDTH,
33
+ height: PUNK_HEIGHT )
34
+ super
56
35
  end
57
- alias_method :[], :punk
58
-
59
36
 
60
- end ## class Composite
61
- end ## class Image
37
+ end ## class ImageComposite
62
38
  end ## module Cryptopunks