Jimp: gif support

Created on 13 Sep 2016  Â·  9Comments  Â·  Source: oliver-moran/jimp

Some people mentioned omggif

Any chances to see support of gifs in Jimp too?

Most helpful comment

I've created a library called gifwrap for working with single- and multi-frame GIFs and still allowing you to leverage Jimp for image manipulation.

All 9 comments

Thanks. Lots of potential there. Including exporting animated gifs. Will add to the road map.

And any contribution of code would naturally be welcome :-)

I believe this must be done by supporting multi layer images. At exporting we could do a GIF, an MNG... or export an multi layer format to another editor, like XCF, OpenRaster... or flatten all layers to a simple JPG or PNG.

is there an ETA for this issue? we need the .gif functionality, since we use this Jimp in production. Many thanks!

Perhaps you may find it useful to generate GIFS with the gifencoder and JIMP

var GIFEncoder = require('gifencoder');
var Jimp = require('jimp');
var fs = require('fs');

var encoder = new GIFEncoder(320, 240);
// stream the results as they are available into myanimated.gif 
encoder.createReadStream().pipe(fs.createWriteStream('myanimated.gif'));

encoder.start();
encoder.setRepeat(0);   // 0 for repeat, -1 for no-repeat 
encoder.setDelay(500);  // frame delay in ms 
encoder.setQuality(10); // image quality. 10 is default. 

// use node-canvas 
var image = new Jimp(320, 240, 0xff0000, function (err, image) {
    encoder.addFrame(image.bitmap.data)
    // use node-canvas 
    var image = new Jimp(320, 240, 0x00ff00, function (err, image) {
        encoder.addFrame(image.bitmap.data)
        // use node-canvas 
        var image = new Jimp(320, 240, 0x0000ff, function (err, image) {
            encoder.addFrame(image.bitmap.data)
            encoder.finish()
        });
    });
})

I've created a library called gifwrap for working with single- and multi-frame GIFs and still allowing you to leverage Jimp for image manipulation.

@jtlapp @ArmorDarks it seems like GIF support was added. Can you verify it does what you need?

omggif is a dep already. if more features are needed new issues should be opened

Ah, I see that Jimp now uses the omggif repo. When I was working with it last year, it was using a local copy.

if more features are needed new issues should be opened

Unless they belong in separate layer which can be implemented as an independent module.

In any case, I've gradually been rewriting Jimp methods for my own purposes at high performance, so I myself don't have any further need for Jimp.

I would love to see those perf improvements in jimp! Do you think they
could be used in jimp?
On Sun, Aug 5, 2018 at 2:34 PM Joe Lapp notifications@github.com wrote:

Ah, I see that Jimp now uses the omggif repo. When I was working with it
last year, it was using a local copy.

if more features are needed new issues should be opened

Unless they belong in separate layer which can be implemented as an
independent module.

In any case, I've gradually been rewriting Jimp methods for my own
purposes at high performance, so I myself don't have any further need for
Jimp.

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/oliver-moran/jimp/issues/166#issuecomment-410549753,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIyBJy2RfmvAfiK5aqNR4xix5XaumCWks5uN2TvgaJpZM4J7036
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molipha picture molipha  Â·  6Comments

fatihturgut picture fatihturgut  Â·  4Comments

dtrofimov picture dtrofimov  Â·  5Comments

haydenbleasel picture haydenbleasel  Â·  6Comments

slidenerd picture slidenerd  Â·  4Comments