forked & inspired by from https://github.com/mash/node-imagemagick-native