目标是在图像上放置标题并将文本颜色设置为与其所在的背景形成对比的颜色。为此,我希望计算以下图像中红色矩形内区域的平均颜色:
convert image.gif -crop 6x7+8+9 -resize 1x1\! -format "%[fx:int(255*r+.5)],%[fx:int(255*g+.5)],%[fx:int(255*b+.5)]" info:-
在 6x7+8+9
中,:
6: image width (pixels)
7: image height (pixels)
8: x-coordinate of top left corner
9: y-coordinate of top left corner
176,191,67