Xwd

Last updated

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]

Contents

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.

X Window Dump
Filename extension
.xwd
Developed by X Window System
Initial releaseX10 / 1985;39 years ago (1985)
Latest release
X11
September 1987;36 years ago (1987-09)
Type of format Image file formats
Standard xwdfile.h [2]
Open format? MIT license

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. [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

Related Research Articles

<span class="mw-page-title-main">GIF</span> Bitmap image file format family

The Graphics Interchange Format is a bitmap image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released on June 15, 1987.

<span class="mw-page-title-main">PNG</span> Family of lossless-compression image file formats

Portable Network Graphics is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF)—unofficially, the initials PNG stood for the recursive acronym "PNG's not GIF".

PCX, standing for PiCture eXchange, is an image file format developed by the now-defunct ZSoft Corporation of Marietta, Georgia, United States. It was the native file format for PC Paintbrush and became one of the first widely accepted DOS imaging standards, although it has since been succeeded by more sophisticated image formats, such as BMP, JPEG, and PNG. PCX files commonly store palette-indexed images ranging from 2 or 4 colors to 16 and 256 colors, although the format has been extended to record true-color (24-bit) images as well.

<span class="mw-page-title-main">FFmpeg</span> Multimedia framework

FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of video and audio files. It is widely used for format transcoding, basic editing, video scaling, video post-production effects and standards compliance.

The BMP file format or bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device, especially on Microsoft Windows and OS/2 operating systems.

<span class="mw-page-title-main">RGBA color model</span> RGB color model with an opacity channel

RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth alpha channel. Alpha indicates how opaque each pixel is and allows an image to be combined over others using alpha compositing, with transparent areas and anti-aliasing of the edges of opaque regions.

<span class="mw-page-title-main">X PixMap</span> Image file format

X PixMap (XPM) is an image file format used by the X Window System, created in 1989 by Daniel Dardailler and Colas Nahaboo working at Bull Research Center at Sophia Antipolis, France, and later enhanced by Arnaud Le Hors.

<span class="mw-page-title-main">X BitMap</span> File format

In computer graphics, the X Window System used X BitMap (XBM), a plain text binary image format, for storing cursor and icon bitmaps used in the X GUI. The XBM format is superseded by XPM, which first appeared for X11 in 1989.

Netpbm is an open-source package of graphics programs and a programming library. It is used mainly in the Unix world, where one can find it included in all major open-source operating system distributions, but also works on Microsoft Windows, macOS, and other operating systems.

The ICO file format is an image file format for computer icons in Microsoft Windows. ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately. In Windows, all executables that display an icon to the user, on the desktop, in the Start Menu, or in file Explorer, must carry the icon in ICO format.

xzgv is a simple, small software utility that can be used for viewing digital images or pictures of several formats, e.g., JPEG, GIF, PNG, etc. xzgv is used on computers using a Unix-like operating system and the X Window System. Because xzgv is a fast, lightweight image viewer that is compatible with a large number of image formats, the viewer is popular on older, slower, resource-challenged computer systems. xzgv is a standard utility in the Damn Small Linux distribution, for example.

A camera raw image file contains unprocessed or minimally processed data from the image sensor of either a digital camera, a motion picture film scanner, or other image scanner. Raw files are so named because they are not yet processed, and contain large amounts of potentially redundant data. Normally, the image is processed by a raw converter, in a wide-gamut internal color space where precise adjustments can be made before conversion to a viewable file format such as JPEG or PNG for storage, printing, or further manipulation. There are dozens of raw formats in use by different manufacturers of digital image capture equipment.

Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output. From the point of view of the client, it acts exactly like any other X display server, serving requests and sending events and errors as appropriate. However, no output is shown. This virtual server does not require the computer it is running on to have any kind of graphics adapter, a screen or any input device. Only a network layer is necessary.

The Apple Icon Image format (.icns) is an icon format used in Apple Inc.'s macOS. It supports icons of 16 × 16, 32 × 32, 48 × 48, 128 × 128, 256 × 256, 512 × 512 points at 1x and 2x scale, with both 1- and 8-bit alpha channels and multiple image states. The fixed-size icons can be scaled by the operating system and displayed at any intermediate size.

Silicon Graphics Image (SGI) or the RGB file format is the native raster graphics file format for Silicon Graphics workstations. The format was invented by Paul Haeberli. It can be run-length encoded (RLE). FFmpeg and ImageMagick, among others, support this format.

In computing, a bitmap graphic is an image formed from rows of different colored pixels. A GIF is an example of a graphics image file that uses a bitmap.

<span class="mw-page-title-main">Screenshot</span> Digital image output of computer display

A screenshot is a digital image that shows the contents of a computer display. A screenshot is created by the operating system or software running on the device powering the display.

WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency.

Sun Raster was a raster graphics file format used on SunOS by Sun Microsystems. The format has no MIME type, it is specified in @(#)rasterfile.h 1.11 89/08/21 SMI. The format was used for some research papers.

The Quite OK Image Format (QOI) is a specification for lossless image compression of 24-bit or 32-bit color raster (bitmapped) images, invented by Dominic Szablewski and first announced on 24 November 2021.

References

  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. 1 2 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.