node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


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) {
        .rotate("green", 45)
        .blur(7, 3)
        .crop(300, 300, 150, 130)
}, 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!