Remove the existing version.
$ brew rm imagemagick
Edit the formula.
$ brew edit imagemagick
This will bring it up in an editor; make sure your $EDITOR
variable is set to your preference (for me: TextMate)
Change it, save it, try re-installing it.
Because most installs use pouring/bottles to install a precompiled binary, you will likely see no change unless you "build from source":
$ brew reinstall --build-from-source
If you're comfortable with git, you may want to make a branch first, and do your edits in a branch.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…