eugeneware / gifencoder

Server side animated gif generation for node.js
Other
472 stars 49 forks source link

Unexpected final result #32

Closed djagiello closed 6 years ago

djagiello commented 6 years ago

My first quality problem was the wrongly set resolution of the output image which resulted in such quality: image After setting the resolution, the picture has definitely returned to a more mundane look: image

Unfortunately, I encountered another problem related to the final result. I have pictures in 8 bit colors, and the output gif has 24 bit colors. This affects the quality of the original image terribly. How can you set the number of colors to 8 bits?

My code:

var encoder = new GIFEncoder(544, 315);
var pngFileStream = require('png-file-stream');
var fs = require('fs');

pngFileStream('slides/tmp_?.png')
    .pipe(encoder.createWriteStream({ repeat: -1, delay: 500, quality: 10 }))
    .pipe(fs.createWriteStream('myanimated.gif'));

My git repository with graphic and code: https://github.com/djagiello/gifgen

heikkipora commented 6 years ago

Would it be possible for you to use 24bit PNGs as the source images ? I don't think gifencoder handles 8bit source images too well.

btw. the gif file format has a maximum of 256 entries in the palette, so it's always 8bit / pixel.

heikkipora commented 6 years ago

Closed as inactive