save this script as script.js
- install node.js
- npm i cgbi-to-png
- put your files in cgbi_in
- run script.js
- check your files in cgbi_out
const cgbiToPng = require('cgbi-to-png'); | |
const fs = require("fs"); | |
fs.readdir("./cgbi_in" , function (err, images) { | |
images.forEach(img=>{ | |
cgbiToPng(fs.createReadStream("./cgbi_in/"+img),function(err,pngStream){ | |
if(err) throw err; | |
pngStream.pipe(fs.createWriteStream("./cgbi_out/"+img)); | |
}); | |
}) | |
}); |