How to use ImageMagick to bulk crop empty space on png files?
To trim a single image:

convert /path/to/original.png -trim +repage /path/to/out/trimmed.png


To trim each png in a folder:

cd /path/to/folder
mkdir ../out
for f in ./*.png; do
  convert "$f" -trim +repage "../out/$f";
done