Here is a bash function that I used to detect whether an image is black on Linux:
function isBlank ()
mean=`convert $1 -format "%[mean]" info:`
It uses ImageMagic to generate formatted image characteristics (the mean).
0, it is a black image.