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