The syntax above is bash. For Windows BAT:
Code: Select all
convert tree.gif ^
-fill black +opaque yellow ^
-fill white -opaque yellow ^
-format "yellow sun pixels = %%[fx:int(w*h*mean+0.5)]" info:
If using v7, use "magick" instead of "convert".
Instead of "yellow", put "red" or "#f00" or "rgb(255,0,0)" or whatever you want. See
http://www.imagemagick.org/script/color.php
When you open a command window, you are in a directory, the "current" directory. When you name a file in an IM command, you can include a directory, if you want:
Code: Select all
convert \mydir\mysubdir\tree.gif ...
If you don't specify a directory, it will look in the current directory.
You can also change to a different directory before running an IM command, if you want.