()
| 66 | }; |
| 67 | |
| 68 | const startCreating = async () => { |
| 69 | const images = getImages(inputDir); |
| 70 | if (images == null) { |
| 71 | console.log("Please generate collection first."); |
| 72 | return; |
| 73 | } |
| 74 | let loadedImageObjects = []; |
| 75 | images.forEach((imgObject) => { |
| 76 | loadedImageObjects.push(loadImgData(imgObject)); |
| 77 | }); |
| 78 | await Promise.all(loadedImageObjects).then((loadedImageObjectArray) => { |
| 79 | loadedImageObjectArray.forEach((loadedImageObject) => { |
| 80 | draw(loadedImageObject); |
| 81 | saveImage(loadedImageObject); |
| 82 | console.log(`Pixelated image: ${loadedImageObject.imgObject.filename}`); |
| 83 | }); |
| 84 | }); |
| 85 | }; |
| 86 | |
| 87 | buildSetup(); |
| 88 | startCreating(); |
no test coverage detected