-
Notifications
You must be signed in to change notification settings - Fork 7
/
generate_sample.rb
103 lines (84 loc) · 1.87 KB
/
generate_sample.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
require 'pixelart'
require_relative 'base'
specs = parse_data( <<DATA )
## archetypes
male1
male2
male3
male4
female1
female2
female3
female4
zombie
ape
alien
orc
bot
demon
male1, top hat
male2, cap
male3, cap forward
male4, cowboy hat
female1, wild blonde
female2, straight hair blonde
female3, blonde bob
female4, crazy hair
zombie, crazy hair
ape, knitted cap
alien, headband
orc, purple hair
bot, crazy hair
demon, top hat
male1, vr
male2, 3d glasses
male3, nerd glasses
male4, regular shades
female1, big shades
female2, classic shades
female3, vr
female4, 3d glasses
zombie, nerd glasses
ape, big shades
alien, classic shades
orc, clown nose
bot, hoodie
demon, vr
male1, hoodie
male2, bandana
male3, clown eyes green, clown nose
male4, earring, mohawk dark
female1, wild blonde
female2, hoodie
female3, clown eyes green, clown nose
female4, top hat
zombie, peak spike
ape, purple hair
alien, cap forward
orc, bandana
bot, cowboy hat
demon, nerd glasses
male4, tears
male4, cowboy hat, tears, frown
male3, cap mcd
male3, cap mcd flipped
male3, cap mcd black
male3, cap mcd white
male3, cap burger king
male3, cap subway
DATA
cols = 14
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/mini#{i}.png" )
img.zoom(10).save( "./tmp/@10x/mini#{i}@10x.png" )
img.zoom(20).save( "./tmp/@20x/mini#{i}@20x.png" )
composite << img
end
composite.save( "./tmp2/minis.png" )
composite.zoom(4).save( "./tmp2/minis@4x.png" )
puts "bye"