1

I need to change my Image type after Uploading. I have tried with image_magick but failed.What is the best way to change a image type.

Rabbani_
  • 450
  • 1
  • 10
  • 30

1 Answers1

3

In my experience, the best ImageMagick alternative in node.js is sharp, based on libvips library.

A simple usage example (convert jpeg to png):

const sharp = require('sharp')
// [...]
sharp('input.jpg')
.rotate()
.toFile('output.png', (err, info) => {
  console.log(info)
})

Docs: https://sharp.pixelplumbing.com/

gnuns
  • 596
  • 5
  • 12