Remove borders/frames from all images in a directory
If you have a bunch of images that look like:
but instead you want them all to look like:
Simply run the following*:
$ for pic in `ls -1 *.jpg`; do convert $pic -fuzz 2% -trim -trim +repage $pic; d
Depending on your photos' qualities, you may need to play with the -fuzz
factor. I have two -trim
options because my pictures have a white frame AND a black border. Each trim
will remove one contiguous colour at a time.
<small>* Requires ImageMagick installed</small>
Written by Bo Jeanes
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#