-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathv3.rb
More file actions
61 lines (36 loc) · 1.2 KB
/
v3.rb
File metadata and controls
61 lines (36 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
###########
# (Cryto)punks V3
#
# to run use:
# ruby ./v3.rb
require 'pixelart'
## read in right-facing punk composite
print "==> loading right-facing punk image..."
punks = ImageComposite.read( "../../awesome-24px/collection/punks.png" )
print "OK\n"
###
# generate a first hundred punks preview composite
punks_v3 = ImageComposite.new( 10, 10, background: '#60a4f7' )
punks.each_with_index do |punk,i|
punks_v3 << punk
## stop (break) after first hundred
# (note: count is zero-based that is, starting with 0 to 99)
break if i >= 99
end
punks_v3.save( "./tmp/punks3.png" )
punks_v3.zoom(4).save( "./tmp/punks3@4x.png" )
print "==> loading right-facing more punk image..."
morepunks = ImageComposite.read( "../../awesome-24px/collection/morepunks.png" )
print "OK\n"
###
# generate a first hundred punks preview composite
morepunks_v3 = ImageComposite.new( 10, 10, background: '#60a4f7' )
morepunks.each_with_index do |punk,i|
morepunks_v3 << punk
## stop (break) after first hundred
# (note: count is zero-based that is, starting with 0 to 99)
break if i >= 99
end
morepunks_v3.save( "./tmp/morepunks3.png" )
morepunks_v3.zoom(4).save( "./tmp/morepunks3@4x.png" )
puts "bye"