Skip to content

Instantly share code, notes, and snippets.

@ShiSHcat
Created June 1, 2022 19:24
Show Gist options
  • Save ShiSHcat/19dff4956cd9453150d750a79a90c85b to your computer and use it in GitHub Desktop.
Save ShiSHcat/19dff4956cd9453150d750a79a90c85b to your computer and use it in GitHub Desktop.
Convert all CGBI pngs in a folder to standard PNGs

save this script as script.js

  1. install node.js
  2. npm i cgbi-to-png
  3. put your files in cgbi_in
  4. run script.js
  5. 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));
});
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment