-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.js
59 lines (33 loc) · 1.04 KB
/
test.js
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
const { getMetadata, compositeImages, resizeImage } = require('./services/Composite')
const CreationCounter = require('./utils/CreationCounter')
let imgArray = ['input/background.png', 'input/image1.png'];
//compositeImages(imgArray, 'out/testOut')
function generate() {
let backs = ['b1', 'b2', 'b3']
let middles = ['m1', 'm2', 'm3']
let tops = ['t1', 't2', 't3']
let layers = [backs, middles, tops]
const max = backs.length * middles.length * tops.length;
let counter = 0;
let imageArray = [];
let maxsArray = [];
layers.forEach(layer => {
maxsArray.push(layer.length - 1)
});
let cc = new CreationCounter(maxsArray)
let result = []
while (counter < max) {
let toPush = ''
for (let lyi = 0; lyi < layers.length; lyi++) {
toPush += layers[lyi][cc.current[lyi]];
}
result.push(toPush)
cc.increment()
counter++
}
console.log(result)
}
function resize() {
resizeImage('input/test/0.png', 500, 500)
}
resize()