I have this Command
Code: Select all
convert Forvaltningsratten.png -resize 20% -bordercolor Black -border 200%x200% 20-perc_Förvaltningsratten.png
I am have to placed it into a script so I can use variables for the -resize value and the -border value.
Here is my script, which is not working corectly. It gives different output sizes depending to the percentage I have as input parameter
Code: Select all
#!/bin/bash
ImageSize=$1 #eg 1280*720
Percent=$2 # eg 30
Color=$3
BorderSize=$(bc -l <<< "($ImageSize/($ImageSize*$Percent/100)/2+10)*10")
convert Forvaltningsratten.png -resize $Percent% -bordercolor $Color -border \ $BorderSize%x$BorderSize% $Percent-perc_Forvaltningsratten.png
~
~
~