I am converting an image from jpg to png, but it is giving the error. Below is the code and error.
gm('E:/image1.jpg').write('E:/image2.png', function(err){
if (err){
console.log(err);
} else{console.log('image converted.')}
})
The error is:
[Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "E:/image1.jpg" "E:/image2.png" this most likely means the gm/convert binaries can't be found]
Do I have to npm graphicsmagick and imagemagick?
Probably graphicsmagick / imagemagick is not installed correctly, download GraphicsMagick or download ImageMagick, if your are using Ubuntu, these commands are useful.
sudo add-apt-repository ppa:dhor/myway
sudo apt-get update
sudo apt-get install graphicsmagick
sudo apt-get install imagemagick