From Surf Wiki (app.surf) — the open knowledge base
Xwd
Command-line program and file format
Command-line program and file format
| Field | Value |
|---|---|
| name | X Window Dump |
| extension | `.xwd` |
| owner | X Window System |
| released | X10 / |
| latest release version | X11 |
| latest release date | |
| genre | Image file formats |
| standard | xwdfile.h |
| open | MIT license |
the computer program
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. | publication-date = 2008 | access-date = 2014-01-23
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
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.
Image format
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.
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.
References
References
- (April 1996). "Encyclopedia of Graphics File Formats, Second Edition". [[O'Reilly_Media.
- (2014). "Image Formats". [[FFmpeg]] General Documentation.
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Xwd — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report