-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgeminis.rb
67 lines (42 loc) · 1.37 KB
/
geminis.rb
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
61
62
63
64
65
66
####################
# to run use:
# ruby ./geminis.rb
require 'cryptopunks'
punks = Punks::Image::Composite.read( '../../programming-cryptopunks/punks.png' )
ids = [0, 2964, 3100, 3393]
offset_x = 14
ids.each do |id|
name = "%04d" % id
punk = punks[id]
punk.save( "./i/punk-#{name}.png" )
gemini = Image.new( 24+offset_x, 24 )
gemini.compose!( punk, 0, 0 )
gemini.compose!( punk, offset_x, 0 )
gemini.save( "./i/gemini-#{name}.png" )
gemini.zoom(4).save( "./i/gemini-#{name}x4.png" )
end
ids.each do |id|
name = "%04d" % id
punk = punks[id]
triplet = Image.new( 24+offset_x*2, 24 )
triplet.compose!( punk, 0, 0 )
triplet.compose!( punk, offset_x, 0 )
triplet.compose!( punk, offset_x*2, 0 )
triplet.save( "./i/triplet-#{name}.png" )
triplet.zoom(4).save( "./i/triplet-#{name}x4.png" )
end
ids.each do |id|
name = "%04d" % id
punk = punks[id]
sextuplet = Image.new( 24+offset_x*5, 24 )
sextuplet.compose!( punk, 0, 0 )
sextuplet.compose!( punk, offset_x, 0 )
sextuplet.compose!( punk, offset_x*2, 0 )
## flip horizonatally (mirror) the next three
sextuplet.compose!( punk.mirror, offset_x*3, 0 )
sextuplet.compose!( punk.mirror, offset_x*4, 0 )
sextuplet.compose!( punk.mirror, offset_x*5, 0 )
sextuplet.save( "./i/sextuplet-#{name}.png" )
sextuplet.zoom(4).save( "./i/sextuplet-#{name}x4.png" )
end
puts "bye"