Skip to content

Instantly share code, notes, and snippets.

@dnlcrl
Created May 26, 2016 11:29
Show Gist options
  • Save dnlcrl/5bdf16e5753987d013c6470122858c09 to your computer and use it in GitHub Desktop.
Save dnlcrl/5bdf16e5753987d013c6470122858c09 to your computer and use it in GitHub Desktop.
#!/bin/bash
file="$1"
for page in $(identify -density 12 -format '%p ' "$file") ; do
if convert "$file[$((page-1))]" -colorspace RGB -unique-colors txt:- | sed -e 1d | egrep -q -v ': \(\s*([0-9]*),\s*\1,\s*\1' ; then
echo $page
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment