Sunday, January 25, 2009

imagemagick: crop all image files

The code below crops all tif images to 61x61 pixels measured from upper left corner of an image (+0+0) and converts and image to 8-bit gray-scale levels.
for f in *.tif; do convert -colorspace Gray -depth 8 +gravity -crop 61x61+0+0 +repage $f ../california2/$f; done

1 comment:

  1. Thanks for this helpful Blog.
    I used a WordPress plugin that I found interesting. So I would like to recommend it.
    The plugin helps me quickly create and customize images before inserting them in my blog post.
    Check at:
    It’s free.