gmify

A simple interface to GraphicsMagick for streaming image processing.

npm install gmify
4 downloads in the last month

Easy Streaming GraphicsMagick

gmify provides a very simple interface to the GraphicsMagick image processer. It's a thin layer around the wonderful gm package, giving an API that satisfies the most common use case:

gmify("source.svg", "dest.png", function (file) {
    file.flip()
        .magnify()
        .rotate("green", 45)
        .blur(7, 3)
        .crop(300, 300, 150, 130)
        .edge(3);
}, function (err) {
    if (err) {
        // `err` is compiled from the raw stderr stream if appropriate.
        // If it doesn't exist, then everything succeeded!
    }
});

(If you want just straight-up format conversion, you can omit the third argument.)

For more info on all the things you can do with a GraphicsMagick file, consult the gm package's documentation.

Finally, don't forget to actually install GraphicsMagick on your system before using!

npm loves you