-
Notifications
You must be signed in to change notification settings - Fork 7
/
generate_doge.rb
61 lines (44 loc) · 1.36 KB
/
generate_doge.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
require 'pixelart'
require_relative 'base'
specs = parse_data( <<DATA )
doge
doge (a), top hat
doge, wild hair (doge)
doge, regular shades, red mohawk (doge)
doge, headband
doge, laser eyes
doge dark
doge dark (a), bandana, gold chain
doge dark, wild white hair (doge)
doge dark, big shades, earring (doge)
doge dark (a), purple hair (doge)
doge dark, laser eyes gold
doge zombie
doge zombie, crazy hair
doge zombie, 3d glasses
doge zombie (a), cowboy hat
doge zombie, laser eyes
doge zombie, knitted cap, nerd glasses, earring (doge)
doge alien
doge alien (a), cap forward, pipe
doge alien (a), cap
doge alien, headband
doge alien, laser eyes blue
doge alien (a), cap mcd
DATA
cols = 6
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/doge#{i}.png" )
img.zoom(10).save( "./tmp/@10x/doge#{i}@10x.png" )
img.zoom(20).save( "./tmp/@20x/doge#{i}@20x.png" )
composite << img
end
composite.save( "./tmp2/doges.png" )
composite.zoom(4).save( "./tmp2/doges@4x.png" )
composite.zoom(10).save( "./tmp2/doges@10x.png" )
puts "bye"