The following script runs on my windows XP system, with the MKS (Unix
lookalike) toolset and Imagemagick installed.
It should also run with Cygwin and under Linux or other Unix lookalikes.
Besides convert and montage, sh, od and awk are used.
Maybe there is a more elegant way to obtain the average color, but I
don't know it.
####################################################################
#!sh
# current directory contains source JPG files
# $DES is where the prepared JPG files are stored
# $TMP is a temporary directory
GEO=832x468 # geometry of target JPG files and resize value
#
for F in *.jpg
do
convert -resize 1x1 "$F" "$TMP/1x1.bmp"
od -A n -j 54 -t u1 "$TMP/1x1.bmp" | awk -v f="$F" -v des="$DES/" -v
geo="$GEO" '
{
print "montage -geometry", geo, "-resize", geo, "-background rgb\\(" $3
"," $2 "," $1 "\\) \"" f "\" \"" des f "\"";
exit;
}'
done | sh -x
####################################################################
--
Have fun, Bert