https://github.com/mike42/yn
Utility to quickly select images from a directory
https://github.com/mike42/yn
Last synced: 3 months ago
JSON representation
Utility to quickly select images from a directory
- Host: GitHub
- URL: https://github.com/mike42/yn
- Owner: mike42
- Created: 2014-06-09T06:23:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-30T05:52:58.000Z (over 9 years ago)
- Last Synced: 2024-12-29T17:45:27.125Z (about 1 year ago)
- Language: Makefile
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Y/N
---
Y/N (Yes/No) is a simple utility to allow humans to quickly filter images within a shell script. Each image is displayed to the user, who presses Y (for yes), N (for no) or Esc to quit.
Every file name which Y is pressed for is printed out. This allows, for example, selection of a subset of screen captures.
Compilation
===========
The utility requires opencv. On Debian, this can be installed with:
```bash
apt-get install libopencv-dev
```
Then clone and compile via the included Makefile:
```bash
git clone https://github.com/mike42/yn
cd yn && make
```
Although only tested on UNIX, the program should run on Windows without modification.
Example usage
=============
A bash script which takes matching images and produces thumbnails (via ImageMagick), outputting HTML for blogging:
```bash
#!/bin/bash
# Basic options
source=source
dest=images
ext=".png"
geometry="150"
# Make dest and find out what images to keep
mkdir -p "$dest"
keep=`./yn "$source"/*$ext`
for orig in $keep
do
# Figure out image parameters
slug=`basename "$orig" "$ext"`
large="$dest/$slug$ext"
thumb="$dest/$slug-small$ext"
# Copy over to dest and make thumbnail
cp "$orig" "$large"
convert "$large" -resize "${geometry}x" "$thumb"
# Make some HTML that could be blogged to include these
echo "
"
done
```