In a bash script (bash is now available on all three platforms: windows, mac and of course linux) Let’s say I want to apply a watermark to all images in a directory, in a loop, using imagemagick. Let’s say the watermark is a file named atcopyright.png (with a transparent background).
for file in *jpg
composite -gravity SouthWest atcopyright.png $file cpy_$file
…the above sort of does it. But if atcopyright.png has white lettering it’s invisible on a light background, and versa visa with dark.
Is there a scriptable way to sample the SouthWest corner of the subject image, and choose between one of two files (atcopyrightLight.png or atcopyrightDark.png)…inside the for
file in *jpg loop?