#!/bin/sh # # isblack - are all of the files supplied as arguments black images? # # $Id$ # thank you, http://www.imagemagick.org/discourse-server/viewtopic.php?t=17111 IsBlack() { convert "$1" -format '%[mean]' info: 2>/dev/null | grep -q '^0$' } for f in "$@" do if IsBlack "$f" then : else exit 1 # no fi done exit 0 # yes