Convert XWD to PNG via command line on Windows

4.5k Views Asked by At

I have a script that generates an XWD file which needs to be converted to a PNG file. When attempting to convert this with ImageMagick, I get the following output. I've found the delegate download site for ImageMagick, however it doesn't appear to have anything for XWD, much less anything for Windows.

enter image description here

I have also tried using the GIMP command line, however I cannot find any solid reference for converting via GIMP on Windows.

2

There are 2 best solutions below

0
On

The XWD format is apart of the X11 sub-system. I believe the windows binary package ships with a bare-bone X library xlib/X11/XWDFile.h. You can verify your local IM install by running the following:

identify -list configure

Find the line that starts with DELEGATES, and look for x in the list. Example:

DELEGATES      bzlib mpeg fontconfig freetype jng jpeg lcms png ps tiff x xml zlib

If x is not present, try re-installing ImageMagick for Windows from source, or evaluate the article Use From Another Package or Program for binary-package installs.

0
On

I would prefer Nconvert from XnView, because no installation is necessary on Windows.

Command line is easy to use:

nconvert.exe -out png input.xwd