Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get the following error when I run the import command of ImageMagick from command-line

import: unable to open X sever '(null)'  @error /import.c/ImportImageCommand/362 [No such file or directory]

However, I have installed X-Server and it is launched in my task-bar. Even then I get this error.

Could you please provide me with some relevant links or solutions.

share|improve this question

If the Windows magick works like the *nix one, then you can try setting DISPLAY environment variable prior to calling it, e.g.

set DISPLAY=localhost:0.0
import ...
share|improve this answer
Try the localhost:0.0 instead – whitequark Aug 23 '10 at 6:48
but what that means , i tried localhost it gives me this error 'localhost' is not recognized as an internal or external command, operable program or batch file. – Muhammad Irfan Aug 23 '10 at 6:50
i am not using php and i just want to capture image from command-line through imagicmagick?? – Muhammad Irfan Aug 23 '10 at 6:52
I thought that ImageMagick doesn't have an address of X server to connect to, and that is reason of this error, but apparently it isn't. – whitequark Aug 23 '10 at 7:09
@Muhammad Irfan: The error means that the DISPLAY variable is not set. If you get "localhost' is not recognized as a command", then you made a mistake setting it. Try set DISPLAY=:0 or set DISPLAY=; many Windows installations don't know "localhost". – Aaron Digulla Aug 23 '10 at 8:08

Windows by default doesn't include an "X Server". You need to install one that is made for Windows first. And it must run when you start ImageMagick's display or import commands.

I would recommend to install the public domain version of the XMing package (documentation). Then, simply launch xlaunch.exe and confirm all default settings. This will get the X Server running on localhost:0.0. Once it runs, your ImageMagick commands import and display will work, at least if you call them like this:

 import -server localhost:0.0 ....
 display -server localhost:0.0 ....
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .