Autocropping all images in folder

Another piece of code I’m putting here for posteriority. Anyways, let’s say I have couple hundred imahes in folder (autogenerated) and I need to crop them automatically (remove extra background).

Here is a quic command that does the trick:

mogrify -trim +repage *.png

This comes with imagemagic suite.