Find and remove all photos below a certain size threshhold
You can use the terminal to do this. The following command should work:
find /path/to/the/folder \
-name "*.jpg" \
-exec bash -c "sips -g pixelHeight -g pixelWidth {} | grep -E ' [12]?[0-9]{0,2}$' >/dev/null" \;\
-print
That command will find all JPEG files under /path/to/the/folder
which have a width or a height of between 1 and 299 pixels.
Replace /path/to/the/folder
with the actual path to your folder.
You can change "*.jpg"
to "*.gif"
to find GIF files instead.
You can change [12]?[0-9]{0,2}
to change the size of the pictures you wish to locate. For example, to find pictures smaller than 500 pixels, use [1234]?[0-9]{0,2}
If you want to review which pictures this command finds, use:
find /path/to/the/folder \
-name "*.jpg" \
-exec bash -c "sips -g pixelHeight -g pixelWidth {} | grep -E ' [12]?[0-9]{0,2}$' >/dev/null" \; \
-exec mv {} /path/to/some/other/folder \;
Replace path/to/some/other/folder
with the folder you want the files moved to, and that command will move the files it finds there.
The way this works is as follows:
The sips
command is the scriptable image processing system. The terminal command sips -g pixelHeight -g pixelWidth some.jpg
will print out the width and height of the JPEG file.
The find
command, as one might expect, finds files. -exec
passed to find tells find
to execute the specified command and only return files for which the command returns a successful result.
The command bash -c "sips -g pixelHeight -g pixelWidth {} | grep -E ' [12]?[0-9]{0,2}$'
invokes a shell, runs sips
to get the image size, and then runs grep
, which searches text, asking grep
to search for either a 1
or a 2
followed by between zero and two digits (0
through 9
). This is a regular expression, and it matches the numbers (strings) 1
through 299
In Aperture you can do this. And More!
Step 1
- Import all files into Aperture.
- Use list view.
Click on an image size criteria to sort by that criteria. Note
pixel dimension
is probably the best method to use.Select all files below your minimum size.
Delete
Now for step 2 assuming these are family photos.
- Turn on face recognition in Aperture, assign names to all recognizable faces.
- Wait until library has been processed.This may take a while depending on number of files.
- Now you can sort by face. (perhaps create a smart album for each face)
- Select all photos containing a particular face.
- Batch change metadata (shift + cmd + b), add a suitable keyword for each face.
Now you can export your files into suitable folders depending on who is in each folder. Plus a folder of files with no one in them.