What is a DDS File?
A DDS file is a DirectDraw Surface container for texture data used by graphics systems. It can hold mipmaps, cube maps, volume textures, and compressed pixel formats suitable for direct GPU use.
How DDS Files work
DDS stores GPU texture data behind a four-byte signature and a fixed header that records dimensions, pixel format, mipmap count, and surface capabilities. Beyond a single 2D image it can describe mipmap chains, cube-map faces, volume textures, and, with the DirectX 10 header extension, texture arrays. The pixel payload is either uncompressed or block-compressed (DXT1 to DXT5, later named BC1 to BC3, plus BC4 to BC7), a form that graphics hardware decodes directly. Because the format grew by extension, files differ in which header fields and format codes they use, and tool support varies by variant.
Key facts
- 1A DDS starts with the magic value
DDS(0x20534444) and a 124-byteDDS_HEADER, so a reader should require at least 128 bytes and check that the header’sdwSizeis 124 and its embeddedDDS_PIXELFORMATsize is 32. When the pixel format setsDDPF_FOURCCwith the FourCCDX10, aDDS_HEADER_DXT10follows and the minimum becomes 148 bytes. These minimums cover the headers only, not the pixel data. That extension is needed for texture arrays and for DXGI formats the legacy pixel-format structure cannot express, and Microsoft notes that not all DDS tools support it. - 2On Direct3D, which block-compressed formats a device accepts depends on its feature level, not on the container: Microsoft lists BC1 to BC3 (the former DXT1 to DXT5) as required at every feature level, BC4 and BC5 from Direct3D 10, and BC6H and BC7 only from Direct3D 11. For the widest tool compatibility, Microsoft recommends the legacy pixel-format header for uncompressed RGB and DXT1 to DXT5 data.
- 3Block-compressed mip levels are stored as whole 4×4 blocks. A level smaller than 4×4 texels is still padded to a full block (8 bytes for BC1 and BC4, 16 bytes for the other BC formats), so level sizes must be computed in blocks rather than pixels; Microsoft’s row formula, evaluated with integer division, is
max(1, (width + 3) / 4) * block-size. - 4Header fields are not reliable across writers. Microsoft advises readers not to depend on the
DDSD_CAPS,DDSD_PIXELFORMAT,DDSD_MIPMAPCOUNT,DDSCAPS_TEXTURE, orDDSCAPS_COMPLEXflags being set, and to compute pitch instead of trustingdwPitchOrLinearSize. Alpha is only partly described: the DX10 header has an alpha-mode field (unknown, straight, premultiplied, opaque, or custom), and a file can leave it at unknown. Among legacy files only theDXT2andDXT4FourCCs indicate premultiplied alpha; other legacy files leave it unspecified and are typically assumed to use straight alpha.
When DDS Files matter
Use DDS when a rendering pipeline benefits from precomputed mipmaps or GPU-native texture compression. Verify format support on the target API and hardware, because unsupported variants require conversion or decompression.
How Transloadit helps with DDS Files
Transloadit’s image format reference, which covers its ImageMagick-based image Robots such as /image/resize, lists DDS and the DXT1 and DXT5 variants as readable and writable.
The reference records format-level read and write support only. It does not say which DDS header variants or BC formats decode, and ImageMagick documents dxt1, dxt5, and uncompressed as its DDS write options, so test representative files before relying on DX10-header or BC7 textures.
Explore Transloadit’s file formats & compression capabilities
Sources
- Microsoft Learn: Programming Guide for DDS (file layout, variants, pitch calculation)
- Microsoft Learn: DDS_HEADER structure
- Microsoft Learn: DDS_HEADER_DXT10 structure
- Microsoft Learn: Texture Block Compression in Direct3D 11 (formats and minimum feature levels)
- Microsoft Learn: Block Compression (Direct3D 10), virtual size versus physical size
- Microsoft Learn: Using Compressed Textures (Direct3D 9), DXT1 to DXT5 and premultiplied alpha
- ImageMagick: Image Formats, DDS entry and dds: defines
- Pillow handbook: Image file formats, DDS (per-variant read and write support)