Can't install ImageMagick with options

All over the internet it tells me that to use ImageMagick’s display command I need to install ImageMagick like so:

brew install imagemagick --with-x11

But when I do that I get an error:

Error: invalid option: --with-x11

(I’m on macOS High Sierra; happy to upgrade to Mojave if that seems likely to help.)

Further research seems to be revealing that Homebrew simply doesn’t support compile/config options anymore. I think I’m going to need to follow the “Install from Unix Source” instructions from ImageMagick.

I tried replacing this step:

./configure

with this step:

./configure --with-x11

But it doesn’t recognize that option.

UPDATE: And it turns out simply following the instructions to install from source worked for me!

Sorry you just follow the instructions and it worked? I follow it but still can’t do it…

Hi suiyschn,
I created a homebrew imagemagick X11 drop-in replacement formulae that you may find useful. It can be used like this:

brew uninstall imagemagick  # without x11 support
brew cask install xquartz
brew install tlk/imagemagick-x11/imagemagick

It tracks the core-formulae but keeps X11 enabled.

Note that giving your formula the same name as the core formula will lead to problems, when a user tries to install one of the 23 other formulae (as of this writing) that depend on imagemagick in some way:

$ brew install pstoedit
==> Downloading https://homebrew.bintray.com/bottles/imagemagick-7.0.10-33.catalina.bottle.tar.gz
Already downloaded: /Users/aho/Library/Caches/Homebrew/downloads/d345aef14ae265117d10c0fd41880488193b9f78dffa8dc9216d50aa8527a5c0--imagemagick-7.0.10-33.catalina.bottle.tar.gz
==> Downloading https://homebrew.bintray.com/bottles/pstoedit-3.75.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/f048d902c088f0625c0c9e18d84b159493775b40e742812b040e7b517900260a?response-content-disposition=attachment%3Bfilename%3D%22pstoedit-3.75.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8
######################################################################## 100.0%
==> Installing dependencies for pstoedit: imagemagick
Error: imagemagick is already installed from tlk/imagemagick-x11!
Please `brew uninstall imagemagick` first."

In addition, I suggest making your formula keg-only, so that it can coexist with the core imagemagick, and users can choose which one to use by enhancing their PATH accordingly.