Xwd

Command-line program and file format

This article is about the computer program. For the all-wheel drive system, see Saab XWD.

This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (June 2008) (Learn how and when to remove this message)

|

In the X Window System, the program xwd (X Window dump) captures the content of a screen or of a window and optionally saves it into a file.[1]

`xwd` runs in one of two ways: if a user specifies the whole screen or the name or identifier of a window as an argument, the program captures the content of the window; otherwise, it changes the shape of the cursor and waits for the user to click in a window, whose content is then captured.

## Operation

[edit]

At the X Window core protocol level, xwd uses the fact that any X client can request the content of an arbitrary window, including ones it did not create, using the `GetImage` request (this is done by the `XGetImage` function in the Xlib library). The content of the whole screen is obtained by requesting the content of the root window.

The file generated by xwd can then be read by various other X utilities such as xwud, sxwd, xv, and the GIMP, or converted to other formats; the ImageMagick suite allows the construction of a useful pipeline:

$ xwd | convert xwd:- screenshot.png

The dumps are larger in size than files in most image file formats – not only compressed formats such as PNG, but also uncompressed bitmap formats like BMP.

X Window DumpFilename extension|

`.xwd`

|

Developed by| X Window System
Initial release| X10 / 1985; 40 years ago (1985)
Latest release|

X11
September 1987; 37 years ago (1987-09)

Type of format| Image file formats
Standard| xwdfile.h[2]
Open format?| MIT license

## Image format

[edit]

Various image viewers and tools support the X11 `.xwd` format, among others the GIMP, ImageMagick, Netpbm, and XnView. In version 2.1.4 FFmpeg supported pixel formats bgra, rgba, argb, abgr, rgb24, bgr24, rgb565be, rgb565le, bgr565be, bgr565le, rgb555be, rgb555le, bgr555be, bgr555le, rgb8, bgr8, rgb4_byte, bgr4_byte, pal8, gray, and monow. In these abbreviations 555 means 32768=32×32×32 colors, 565 means 65536 colors (6 bits for green), rgba is red-green-blue-alpha, 4 or 8 stands for 16 or 256 colors, le or be is the endianness, pal is an input palette, etc. as listed by `ffmpeg -pix_fmts`.[3]

Details of the `.xwd` format in `XWDFile.h` depend on the platform, therefore it is unsuited for cross-platform applications and has no MIME image type.[2]

## See also

[edit]

* X BitMap (XBM)
* X PixMap (XPM)

## References

[edit]

1. ^ Tyler, Chris (2008). X Power Tools. O'Reilly Series. O'Reilly Media, Inc. p. 107\. ISBN 9780596101954. Retrieved 2014-01-23. "The X window dump (xwd) tool takes a snapshot of the current screen, a manually selected window or a window designated by its numeric ID, and outputs the image to standard output or to a file."
2. ^ a b James D. Murray; William vanRyper (April 1996). Encyclopedia of Graphics File Formats, Second Edition. O'Reilly. ISBN 1-56592-161-5. Retrieved 2014-02-27.
3. ^ "Image Formats". FFmpeg General Documentation. 2014. Retrieved 2014-02-23.

## External links

[edit]

* xwd is part of X11's standard distribution, but its source can also be downloaded separately as tar.bz2 or tar.gz
* Image::XWD Perl package at CPAN

* v
* t
* e

Graphics file formats

Raster|

* ANI
* ANIM
* APNG
* ART
* AVIF
* BMP
* BPG
* BSAVE
* CAL
* CIN
* CPC
* CPT
* DDS
* DPX
* ECW
* EXR
* FITS
* FLIC
* FLIF
* FPX
* GIF
* HDRi
* HEVC
* ICER
* ICNS
* ICO/CUR
* ICS
* ILBM
* JBIG
* JBIG2
* JNG
* JPEG
* JPEG LS
* JPEG 2000
* JPEG XL
* JPEG XR
* JPEG XS
* JPEG XT
* JPEG-HDR
* KRA
* MNG
* MIFF
* NRRD
* ORA
* PAM
* PBM/PGM/PPM/PNM
* PCX
* PGF
* PICtor
* PNG
* PSD/PSB
* PSP
* QOI
* QTVR
* RAS
* RGBE
* Logluv TIFF
* SGI
* TGA
* TIFF
* TIFF/EP
* TIFF/IT
* UFO/UFP
* WBMP
* WebP
* XBM
* XCF
* XPM
* XWD

Raw|

* CIFF
* DNG

Vector|

* AI
* CDR
* CGM
* DXF
* EMF
* EMF+
* Gerber
* HVIF
* IGES
* PGML
* SVG
* VML
* WMF
* Xar

Compound|

* CDF
* DjVu
* EPS
* MODCA
* PDF
* PICT
* PS
* SWF
* XAML

Metadata|

* Exchangeable image file format (Exif)
* International Press Telecommunications Council § Photo metadata
* Extensible Metadata Platform (XMP)
* GIF § Metadata
* Steganography

Comparison •  Category
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template