imagemagick

Cropping and resizing

Image resizing and cropping using bash script This script benefits from following pages: https://stackoverflow.com/questions/918886/how-do-i-split-a-string-on-a-delimiter-in-bash https://stackoverflow.com/questions/18544359/how-to-read-user-input-into-a-variable-in-bash https://github.com/DeependraD/DeependraD.github.io/blob/sources/deploy.sh Note: Set the English locale for the date command. #!/usr/bin/env bash export LC_TIME=en_US.UTF-8 msg() { printf "\033[1;32m :: %s\n\033[0m" "$1" } msg "To run this script you must have imagemagick library installed.

Cylinder

#!usr/bin/env bash # To create a png of cylinder showing 50% fill. First you need imagemagick library installed to use "convert" function. convert -size 320x90 canvas:none -stroke snow4 -size 1x90 -tile gradient:white-snow4 \ -draw 'roundrectangle 16, 5, 304, 85 20,40' +tile -fill snow \ -draw 'roundrectangle 264, 5, 304, 85 20,40' -tile gradient:chartreuse-green \ -draw 'roundrectangle 16, 5, 180, 85 20,40' -tile gradient:chartreuse1-chartreuse3 \ -draw 'roundrectangle 140, 5, 180, 85 20,40' +tile -fill none \ -draw 'roundrectangle 264, 5, 304, 85 20,40' -strokewidth 2 \ -draw 'roundrectangle 16, 5, 304, 85 20,40' \( +clone -background snow4 \ -shadow 80x3+3+3 \) +swap -background none -layers merge \( +size -font Helvetica \ -pointsize 90 -strokewidth 1 -fill red label:'50 %' -trim +repage \( +clone \ -background firebrick3 -shadow 80x3+3+3 \) +swap -background none -layers merge \) \ -insert 0 -gravity center -append -background white -gravity center -extent 320x200 \ cylinder_shaded.