2

I successfully used -verbose to find median RGB values for 1 .jpg file.

Next step is finding median RGB values for about 2000 .jpg files.

Id like to figure out how to do this automatically rather than one at a time.

Id also like to figure out how to export the data resulting from -verbose over 2000 files to something like .csv or .txt.

Does anyone know how to best approach this?

4

1 回答 1

2

这将为您提供当前工作目录中所有 .jpg 图像的所有详细信息:

识别 -verbose *.jpg >verbose.txt

如果你在 Unix 系统上,这个会转储到 verbose.txt 行filename => overall RGB mean value

*.jpg 中的 f;做 echo "$f => `identify -verbose "$f" | grep mean | tail -n1 | cut -d':' -f2 | xargs`"; 完成 >verbose.txt

这将转储到 verbose.txt 行filename => R = mean value, G = mean value, B = mean value

*.jpg 中的 f;做 echo "$f => `identify -verbose "$f" | grep mean | head -n3 | cut -d':' -f2 | xargs | awk '{print "R = "$1" "$2", G = "$3" "$4", B = "$5" "$6}'`"; 完成 >verbose.txt
于 2013-11-01T03:27:33.627 回答