ASIDE: the colors represent biomes in a randomised world generator.
This is the code I am currently using (ignoring the image source and other irrelevent stuff)
Code: Select all
color1='magenta'
color2='#B4DCDC'
color3='#FF6D3D'
color4='#E5DA87'
search=`convert image.png \
-fill black -opaque "white" \
-fill white -opaque "$color1" \
-fill white -opaque "$color2" \
-fill white -opaque "$color3" \
-fill white -opaque "$color4" \
-fill black +opaque "white" \
-scale 1x1 \
-depth 16 txt:- |
sed '1d; /black/d'`
if [ "X$search" != "X" ]; then
echo "===================Found One================"
# ....
fi
Now the above is straight forward. but what I now need is a similar test for an image that contains ALL of these colors, not just any one of them. Logically a test for an image containing a 'AND' of the colors, not just a 'OR'.
I am a little stumped by the problem. perhaps I am just having a brain block as I am usually pretty good at solving it.