For quickly classifying a lot of images I use feh. The idea is to separate images into different folders named A, B, C, etc. without deleting any file, just moving the current image out of the way. You decide which image goes into which folder--the meaning of each folder is your own choice and it's the "classification tag" of the folder, say "pics to be delete", "family pics", "large size", whatever tags you need to make up as you sift through the pictures. You move the current image to folder A by pressing key a, to folder B by pressing key b, etc. When an image is moved feh displays the next image automatically. So you just sit, look at an image, press a, look at the next image press, say, a again, one more image, press c, new image, b, new image, a, ... until the whole list is exhausted. At the end all images are classified in some folder. In your case you could reserve folder A for images you want to keep, C for images to delete, and B for not so sure. Feh gives you up to 10 keys therefore 10 tags / 10 folders. Feh runs from the command line and displays a graphical window. Here's a sample setup consisting of a configuration file that defines keys a, b and c, and a script that runs feh.
File ~/.config/feh/keys
File sift.sh (put it somewhere in your PATH and make it executable)
Code: Select all
#!/bin/sh
#font="--fontpath ${0%/*} --menu-font yudit/12"
# create folders for action keys in ~/.config/feh/keys
mkdir -p A B C
# move the next feh window to (39,0)
if command -v xdotool >/dev/null 2>&1; then
(
sleep 0.1
set -e
pid=$(pgrep -n feh)
xid=$(xdotool search -pid $pid)
xdotool windowmove $xid 39 0
) &
fi
# accepts dirpath or filepaths
exec feh \
--keep-zoom-vp \
$font \
--action1 "mv -v %N A" \
--action2 "mv -v %N B" \
--action3 "mv -v %N C" \
"$@"
Usage
With feh's window placed in the upper left corner of the screen, you want to open a terminal in the lower right corner of the screen, cd into the folder that holds the images to be classified, run sift.sh *.jpg (for a collection of JPEG images in the folder) and start pressing a or b or c until you're done. If you need more folders and actions extend ~/.config/feh/keys, the mkdir command in sift.sh and also add --action4 "mv %N D", etc. to it
The script places feh's window in the upper left corner of the screen using xdotool. If you don't have xdotool the window manager will place feh's window randomly. Finding the most confortable relative position between the feh's window and the terminal enhanced usability. You might prefer to keep the terminal to the left of feh's window. In that case change the 0,39 coordinates in the script, or reposition manually. It is possible for feh's window to cover the terminal as it advances through the pictures. This happens when the picture is very large. Nevertheless, keyboard focus will stay with the terminal, so you can keep pressing a, b, c,.. even if the current picture covers the terminal.