cryptopunks 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46893056723659824049de9a524ef3e684c0b17144952b5a4e24af8a780954b4
4
- data.tar.gz: 9444d2f5353ae3cb8fae51317d99c53052b5435cc3b1f470da88963283b88c2f
3
+ metadata.gz: f8f5a03075399de98c5456fd8c74bcd84c2bebea84b033131351c737dd1934ba
4
+ data.tar.gz: cb75041e34f7104b4e19ab9913a66d3383273299f0a2bec10b53d2c6d428f4f0
5
5
  SHA512:
6
- metadata.gz: 17d6dbd68977c9a6748b9c56357483ac1f69f89ca174bcb083f7b75b200eec76a49a61bcc500e73e4f3b27d3d948732f36ceccf827e40fc138c85910a2a0218b
7
- data.tar.gz: ba47af528c1d8c687b341f8b2496ee777fd7ea44ed4bc7d18fe7f80c5c8f05c32b59e824139371c7e9da645779212fe2af9f2a52f63c47ea3283ba0b947bd455
6
+ metadata.gz: 258ce6be66ad8a06dae14aeb916e620549e50e2dc82a3d96964dbd31e7766df5205b89e630cf3c703b2dbbc52d0e14c4314751447e200ceab47fc7d8bbc81891
7
+ data.tar.gz: c5d5556a2a644a25431f666fb46aa667c0460a721e379b43e17284e4400cb3b515e34d10fa28f2105dd0b45ea5c2bb039518bd45cf59aa2e1da8e98be455871e
data/README.md CHANGED
@@ -117,6 +117,115 @@ And x8:
117
117
  And so on.
118
118
 
119
119
 
120
+
121
+
122
+ ## 10 000 More Punks - Unauthorized? No Way?!- Fuck the Establishment - Yes, You Can - Do-It-Yourself - Use Your Own Collections
123
+
124
+
125
+ Use the `-f, --file=FILE` option
126
+ to pass along any unauthorized edition.
127
+ Only make sure all punks are lined-up left-to-right, top-to-bottom
128
+ in the 24x24 pixel format in the composite image.
129
+
130
+
131
+ Let's try the 10 000 More Punks series housing punks in
132
+ packs of a hundred each. Let's have a looksie at the first 100
133
+ in the series.
134
+
135
+
136
+ ![](https://github.com/cryptopunksnotdead/awesome-cryptopunks-bubble/raw/master/i/more-punks-1.png)
137
+
138
+
139
+
140
+ Let's mint punk #0, #19, #50, and #89
141
+ and let's add an offset of 10000
142
+ (to start counting at 10000 instead of 0):
143
+
144
+ ```
145
+ $ punk 0 18 40 88 --file ./more-punks-1.png --offset 10000
146
+ ```
147
+
148
+ printing:
149
+
150
+ ```
151
+ ==> reading >./more-punks-1.png<...
152
+ 240x240 (height x width)
153
+ ==> (1/4) minting punk #10000; writing to >./punk-10000.png<...
154
+ ==> (2/4) minting punk #10018; writing to >./punk-10018.png<...
155
+ ==> (3/4) minting punk #10040; writing to >./punk-10040.png<...
156
+ ==> (4/4) minting punk #10040; writing to >./punk-10088.png<...
157
+ ```
158
+
159
+ And voila!
160
+
161
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10000.png)
162
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10018.png)
163
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10040.png)
164
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10088.png)
165
+
166
+
167
+ And 4x:
168
+
169
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10000x4.png)
170
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10018x4.png)
171
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10040x4.png)
172
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10088x4.png)
173
+
174
+
175
+
176
+
177
+ Let's try the second pack - that is, punks 100 to 199 in the series.
178
+
179
+
180
+ ![](https://github.com/cryptopunksnotdead/awesome-cryptopunks-bubble/raw/master/i/more-punks-2.png)
181
+
182
+
183
+
184
+ Let's mint punk #0, #79, #80, and #90
185
+ and let's add an offset of 10100
186
+ (to start counting at 10000 plus 100 instead of 0):
187
+
188
+ ```
189
+ $ punk 0 79 80 90 --file ./more-punks-2.png --offset 10100
190
+ ```
191
+
192
+ printing:
193
+
194
+ ```
195
+ ==> reading >./more-punks-2.png<...
196
+ 240x240 (height x width)
197
+ ==> (1/4) minting punk #10100; writing to >./punk-10100.png<...
198
+ ==> (2/4) minting punk #10179; writing to >./punk-10179.png<...
199
+ ==> (3/4) minting punk #10180; writing to >./punk-10180.png<...
200
+ ==> (4/4) minting punk #10190; writing to >./punk-10190.png<...
201
+ ```
202
+
203
+ And voila! Super rare - world's first female alien and much more.
204
+
205
+
206
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10100.png)
207
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10179.png)
208
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10180.png)
209
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10190.png)
210
+
211
+
212
+ And 4x:
213
+
214
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10100x4.png)
215
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10179x4.png)
216
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10180x4.png)
217
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-10190x4.png)
218
+
219
+
220
+ And so on.
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
120
229
  ## Usage in Your Scripts
121
230
 
122
231
 
data/lib/cryptopunks.rb CHANGED
@@ -25,6 +25,7 @@ class Tool
25
25
  opts = { zoom: 1,
26
26
  outdir: '.',
27
27
  file: './punks.png',
28
+ offset: 0,
28
29
  }
29
30
 
30
31
  parser = OptionParser.new do |cmd|
@@ -46,6 +47,9 @@ class Tool
46
47
  opts[:file] = file
47
48
  end
48
49
 
50
+ cmd.on("--offset=NUM", "Start counting at offset (default: #{opts[:offset]})", Integer ) do |offset|
51
+ opts[:offset] = offset
52
+ end
49
53
 
50
54
  cmd.on("-h", "--help", "Prints this help") do
51
55
  puts cmd
@@ -72,7 +76,7 @@ class Tool
72
76
 
73
77
  punk = punks[ punk_index ]
74
78
 
75
- punk_name = "punk-" + "%04d" % punk_index
79
+ punk_name = "punk-" + "%04d" % (punk_index + opts[:offset])
76
80
 
77
81
  ## if zoom - add x2,x4 or such
78
82
  if opts[:zoom] != 1
@@ -81,7 +85,7 @@ class Tool
81
85
  end
82
86
 
83
87
  path = "#{opts[:outdir]}/#{punk_name}.png"
84
- puts "==> (#{index+1}/#{args.size}) minting punk ##{punk_index}; writing to >#{path}<..."
88
+ puts "==> (#{index+1}/#{args.size}) minting punk ##{punk_index+opts[:offset]}; writing to >#{path}<..."
85
89
 
86
90
  punk.save( path )
87
91
  end
@@ -8,9 +8,6 @@ module Cryptopunks
8
8
  new( data )
9
9
  end
10
10
 
11
- PUNK_ROWS = 100
12
- PUNK_COLS = 100
13
- PUNK_COUNT = PUNK_ROWS * PUNK_COLS ## 10_000 = 100x100 (24000x24000 pixel)
14
11
 
15
12
  PUNK_HEIGHT = 24
16
13
  PUNK_WIDTH = 24
@@ -18,22 +15,19 @@ module Cryptopunks
18
15
  PUNK_HASH = 'ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b'
19
16
 
20
17
 
21
-
22
18
  def initialize( data )
23
19
  @punks = ChunkyPNG::Image.from_blob( data )
24
20
  puts " #{@punks.height}x#{@punks.width} (height x width)"
25
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)
25
+
26
26
  ## check sha256 checksum
27
27
  @hexdigest = sha256( data )
28
28
  if original?
29
29
  puts " >#{@hexdigest}< SHA256 hash matching"
30
30
  puts " ✓ True Official Genuine CryptoPunks™ verified"
31
- else
32
- puts " !! ERROR: >#{hexdigest}< SHA256 hash NOT matching"
33
- puts " >#{PUNK_HASH}< expected for True Official Genuine CryptoPunks™."
34
- puts ""
35
- puts " Sorry, please download the original."
36
- exit 1
37
31
  end
38
32
  end
39
33
 
@@ -52,11 +46,11 @@ module Cryptopunks
52
46
 
53
47
 
54
48
 
55
- def size() PUNK_COUNT; end
49
+ def size() @punk_count; end
56
50
 
57
51
 
58
52
  def punk( index )
59
- y, x = index.divmod( PUNK_ROWS )
53
+ y, x = index.divmod( @punk_rows )
60
54
  img = @punks.crop( x*PUNK_WIDTH, y*PUNK_HEIGHT, PUNK_WIDTH, PUNK_HEIGHT )
61
55
  Pixelart::Image.new( img.width, img.height, img ) ## wrap in pixelart image
62
56
  end
@@ -3,8 +3,8 @@
3
3
  module Cryptopunks
4
4
 
5
5
  MAJOR = 1
6
- MINOR = 1
7
- PATCH = 1
6
+ MINOR = 2
7
+ PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.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: 2021-04-22 00:00:00.000000000 Z
11
+ date: 2021-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart