Tag Archives: Miniatures

Shell scripts that copy, rename files and resize, crop images

I have written a bunch of shell scripts for my Mac, that do a lot of work automatically.

First script renames all files in a folder sequentially and gives the names with numbers starting from 64:

The second script creates copies of those files and adds “_mini” to the file name. It creates future miniatures of images.

The third script deletes all files in a folder that do not match a pattern with “_mini” word:

And the last script crops images to the given size:

It is also possible to resize images in other ways, for example percentage:

Here are the full instructions for ImageMagick.

Here is an information on copying files.

And here is an information on deleting by pattern.

Finally we get something like this:
Снимок экрана 2014-08-15 в 0.15.56

Final script:

This script rename files with spaces in their file names:

Here you can read more about treating spaces in file names in bash scripts.