To solve the issue in Mac OSX Sierra, High Sierra, El Capitan, Mojave, Catalina, Big Sur, and Monterey (M1 chip), you can do the following:
brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force
imagemagick@6
is keg-only
, so you’ll need to force linking.