Closed ChitaGideon closed 8 years ago
If the png has an alpha channel, that could happen. You should try putting a color transform to rgb in the middle.
you are right change my code to
fs.createReadStream(file)
.pipe(new PNGDecoder)
.pipe(new ColorTransform('rgb'))
.pipe(new JPEGEncoder)
.pipe(fs.createWriteStream('indexed.jpg'));
anything make sence
the png is this:
code:
and the convert result :