I am trying to combine a sequence of PNGs to create a GIF. However, I am getting two issues:
The GIFs rendered have some colors missing (usually white and light colors) that get replaced by black (see images below)
Sometimes the outputted file doesn't even read, showing up with the broken image icon when I try to view it in a browser
CODE
const fs = require("fs");
const os = require('os');
const GIFEncoder = require('gifencoder');
const pngFileStream = require('png-file-stream');
const stream = pngFileStream(os.tmpdir() + '/frame_?.png')
.pipe(encoder.createWriteStream({ repeat: 0, delay: 500, quality: 30 }))
.pipe(fs.createWriteStream(os.tmpdir() + '/myanimated.gif'));
EXAMPLE
- Output GIF
- Inputed Images (PNG)






