-
Notifications
You must be signed in to change notification settings - Fork 7
/
generate_monkes.rb
51 lines (35 loc) · 1.24 KB
/
generate_monkes.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
require 'pixelart'
require_relative 'base'
specs = parse_data( <<DATA )
monke light
monke orange
monke pink
monke orc
monke alien
monke light, clown eyes green (monke), clown nose (monke), mohawk (monke)
monke orange, peak spike (monke)
monke pink, mohawk blonde (monke)
monke orc, mohawk red (monke)
monke alien, mohawk purple (monke)
monke light, polarized shades (monke), peak spike (monke)
monke orange, peak spike (monke), 3d glasses (monke)
monke pink, mohawk2 blonde (monke), 3d glasses (monke)
monke orc, cap red (monke)
monke alien, mohawk2 purple (monke), vr pro (monke)
DATA
cols = 5
rows = specs.size / cols
rows += 1 if specs.size % cols != 0
composite = ImageComposite.new( cols, rows,
width: 12, height: 12 )
specs.each_with_index do |spec, i|
img = generate( *spec)
img.save( "./tmp/monke#{i}.png" )
img.zoom(10).save( "./tmp/@10x/monke#{i}@10x.png" )
img.zoom(20).save( "./tmp/@20x/monke#{i}@20x.png" )
composite << img
end
composite.save( "./tmp2/monkes.png" )
composite.zoom(4).save( "./tmp2/monkes@4x.png" )
composite.zoom(10).save( "./tmp2/monkes@10x.png" )
puts "bye"