Maybe try to use sharp instead of ImageMagick?
For performance and running in Node.js without requiring any additional install or runtime dependencies.