I have a bash shell script as below.
#!/bin/bash SIZES=("512" "1024" "2048") for i in ${!SIZES[*]} do SIZE=${SIZES[$i]} echo $SIZE # first, resize original image convert -resize $SIZE"x"$SIZE! chernarus2048.jpg chernarus$SIZE"x"$SIZE.jpg mkdir tiles$SIZE # slice resized image into 256x256 tiles convert -crop 256x256 chernarus$SIZE"x"$SIZE.jpg tiles$SIZE/tile%04d.jpg rm chernarus$SIZE"x"$SIZE.jpg done
But when I run this in command line using the following command
sh generate_tiles.sh chernarus2048.jpg
I'm getting an error convert: command not found
I'm using OS X Yosemite 10.10.2.The image is kept in the same folder where the shell script is placed. Please help me out.
In computing, convert is a command-line utility included in the Windows NT operating system line. It is used to convert volumes using the FAT file systems to NTFS.
The convert command is used to change FAT volumes to NTFS.
convert is part of the package ImageMagick; try sudo yum install ImageMagick (or other privilege escalation method as appropriate to your system). Show activity on this post. Next time you need a command like this you can figure out what package to install by running something like yum whatprovides '*/convert' .
You can also make it with help of Homebrew - which is quite nice and popular package manager
To Install homeBrew past in your terminal
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install imagemagick past in the terminal
brew install imagemagick
Steps to follow
install using command$ sudo port install ImageMagick
or using Homebrew command brew install imagemagick
or download from the link http://cactuslab.com/imagemagick/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With