instantreality 1.0

Texture file types

Keywords:
BMP, DDS, DXT1a, DXT1c, DXT3, DXT5, EXR, GIF, HRD, JP2, JPG, MTD, NRRD, PNG, PNM, PSD, SGI, TGA, TIF, Advantages, Compression algorithm, Disadvantages, File extension, Magic-Word, MIME-Type
Author(s): Jürgen Müller
Date: 2007-08-14

Summary: This tutorial show you the advantages and disadvantages from the different texture file types, which are supportet by instantPlayer.

General

It is important to use not only one texture format, because they are not all perfect for every situation. In some cases, it is more important to have a higher performance, in some other it has to be nearly realistic. But if you use large BMP-Files for example to make your scene look good, you maybe become great problems because the performens goes down. Nor is it reasonable to have a high detailed texture at a great distance from the viewer. In this case you get better, if you use a format that supports MipMaps. But in detail, I show you all things of interest in this tutorial. As next, I told you, why I'd choosed the following topics, to present you the formats.

File Extensions

I will show you all extensions of each format. So, you will be able to know the file format of the file you currently have, only by looking at the extension.

Magic-Word

But, if the file maybe does not have an extension, you are able to detect the format, by looking inside of it. Mostly the first four bytes are containing the so called "Magic-Word", which names the image format of the current file. To read it, you have to convert these four bytes into ASCII, for example using an hex editor.

MIME-Types

The "Multipurpose Internet Mail Extensions" is a standard that extends the support from e-mails. If a texture format has such one, you can identify it, only by looking on that extension.

Color Modes

One possibility to reduce the size of an image is to reduce the color depth. In some cases you don't recognize the difference but save a lot of memory space. But not all formats support any color depth, so I list you the supported depths at each format.

Compression Algorithm

The most important way to reduce the size is to compress the file with an compression algorithm. But there are a lot of different algorithms and with different advantages and disadvantages. For example there are lossy and lossless compression algorithms. If it is unacceptable to reduce the quality you have to take a lossless algorithm because the quality is still the same, but the size can be reduced up to 30%. But if performance is the important point, you drive much better, using lossy compressions, because they can produce much smaller files.

Supporting Tools

Under this caption I give you a list, of some well known (if there any) tool, that can handle the actual file format.

Advantages / Disadvantages

And last but not least, I list some advantages and disadvantages of the formats for an quick overview of the format.

BMP

General Informations

The "Windows Bitmap" format was introduced by the "Microsoft Corporation".

File extensions

  • .bm (very unusual)
  • .bmp

Magic-Word

  • BM

MIME-Types

  • image/bmp
  • image/x-bmp
  • image/x-ms-bmp (unofficial)
  • image/x-windows-bmp (unofficial)

Color modes

  • 1 bit
  • 4 bit
  • 8 bit
  • 16 bit
  • 24 bit
  • 32 bit

Compression algorithm

  • None
  • Run-length encoding

Supporting Tools

  • Adobe Photoshop
  • Corel Paint Shop Pro
  • Krita
  • Microsoft Paint
  • Paint.NET
  • The GIMP
  • Ulead PhotoImpact
  • ... and many more.

Advantages

  • Lossless
  • Meta-data supported
  • Supported by web-browser
  • Transparency supported
  • Widely adopted

Disadvantages

  • Low uncompression rate
  • No animations supported
  • No multipages supported
Image: An example of an BMP image.
Files:

DDS

General Informations

The "DirectDraw Surface" format was introduced by the "Microsoft Corporation".

File extensions

  • .dds

Magic-Word

  • DDS

MIME-Types

  • None

Color modes

  • 4 bit (integer)
  • 8 bit (integer)
  • 16 bit (integer)
  • 16 bit (floating-point)
  • 32 bit (floating-point)
  • 64 bit (floating-point)
  • 128 bit (floating-point)

Compression algorithm

  • None
  • DXGI_FORMAT_BC1 (DXT1c)
  • DXGI_FORMAT_BC1 (DXT1a)
  • DXGI_FORMAT_BC2 (DXT3)
  • DXGI_FORMAT_BC3 (DXT5)
  • DXGI_FORMAT_BC4 (ATI1N) [not supported by instantPlayer]
  • DXGI_FORMAT_BC5 (ATI2N / 3Dc) [not supported by instantPlayer]

Supporting Tools

  • Adobe Photoshop (with plug-in)
  • Corel Paint Shop Pro (with plug-in)
  • DirectX Texture Editor (partial)
  • NVIDIA DDS Utilities (partial)
  • NVIDIA Texture Tools 2 Alpha
  • Paint.NET (partial)
  • The Compressionator (ATI)
  • The GIMP (with plug-in)

Advantages

  • Known image size
  • Meta-data supported
  • Mipmaps supported
  • Multipage supported
  • Native execution from the GPU
  • Normalmap supported
  • Transparency supported

Disadvantages

  • No animations supported
Files:

EXR

The "OpenEXR" format was introduced by "Industrial Light & Magic".

File extensions

  • .exr

Magic-Word

  • None

MIME-Types

  • None

Color modes

  • 16 bit (floating-point)
  • 32 bit (floating-point)
  • 32 bit (integer)

Compression algorithm

  • None
  • Run length encoding
  • ZIP (per scanline)
  • ZIP (16 scanline blocks)
  • PIZ (wavelet compression)
  • PXR24 (24 bit data conversion then zipped compression)
  • B44
  • ...easily addition of new compression methods

Supporting Tools

  • Adobe Photoshop
  • Krita

Advantages

  • EXIF Header
  • Meta-data supported
  • Mipmappes supported
  • Transparency supported

Disadvantages

  • No animations supported
  • No multipages supported
  • Not yet widely adopted
Files:

GIF

The "Graphics Interchange Format" was introduced by "CompuServe".

File extensions

  • .gif

Magic-Word

The number specifies the version of gif.

  • GIF87a
  • GIF89a

MIME-Types

  • image/gif
  • image/giff

Color modes

  • 1 bit
  • 2 bit
  • 3 bit
  • 4 bit
  • 5 bit
  • 6 bit
  • 7 bit
  • 8 bit

Compression algorithm

  • Lempel-Ziv-Welch-Algorithmus

Supporting Tools

  • Adobe Photoshop
  • Corel Paint Shop Pro
  • Krita
  • Microsoft Paint
  • Paint.NET
  • The GIMP
  • Ulead PhotoImpact
  • ... and many more.

Advantages

  • Animation supported
  • Lossless (till 8 bit color depth)
  • Meta-data supported
  • Multipage supported
  • Supported by web-browser
  • Transparency supported
  • Widely adopted

Disadvantages

  • Only 1 bit alpha value
  • Only up to 8 bit color depth
Image: An example of an GIF image.
Files:

HDR

The "High Dynamic Range" format was introduced by "???".

File extensions

  • .hdr

Magic-Word

  • #?RADIANCE.#

MIME-Types

  • None
  • Run length encoding

Color modes

  • 24 bit
  • 32 bit

Compression algorithm

  • None

Supporting Tools

  • Adobe Photoshop
  • Krita
  • Ulead PhotoImpact

Advantages

  • EXIF Header
  • Meta-data supported
  • Photometrically correct color save

Disadvantages

  • No animations supported
  • No multipages supported
  • No transparency supported
  • Not yet widely adopted
Files:

JPEG

The "Joint Photographic Experts Group" format was introduced by the "Joint Photographic Experts Group".

File extensions

  • .jpg
  • .jpeg
  • .jpe
  • .jfif
  • .jfi

Magic-Word

  • JFIF

MIME-Types

  • image/jpeg

Color modes

  • 8 bit (greyscale)
  • 12 bit
  • 24 bit

Compression algorithm

The compression runs in multiple pathes:

  • Color space transformation, mostly from RGB space to YCbCr space (lossless).
  • Chroma subsampling
  • Block splitting into 8×8-Blocks
  • Discrete cosine transform of the blocks
  • Quantization
  • Entropy coding

Supporting Tools

  • Adobe Photoshop
  • Corel Paint Shop Pro
  • Krita
  • Microsoft Paint
  • Paint.NET
  • The GIMP
  • Ulead PhotoImpact
  • ... and many more.

Advantages

  • EXIF Header
  • Meta-data supported
  • Supported by web-browser
  • Widely adopted

Disadvantages

  • No animations supported
  • No multipages supported
  • No transparency supported
Image: An example of an JPEG image.
Files:

JPEG2000

The "Joint Photographic Experts Group 2000" format was introduced by the "Joint Photographic Experts Group".

File extensions

  • .jp2
  • .jpx
  • .j2c

Magic-Word

  • jp2

MIME-Types

  • image/jp2
  • image/jpeg2000
  • image/jpeg2000-image
  • image/x-jpeg2000-image

Color modes

  • 8 bit (greyscale)
  • 12 bit
  • 24 bit

Compression algorithm

The compression runs in multiple steps.

  • Tiling
  • Multiple component transform
  • Wavelet transform
  • Scalar quantization
  • Region of interest
  • Entropy coding
  • Rate allocation

Supporting Tools

  • Adobe Photoshop
  • Corel Paint Shop Pro
  • Krita
  • Ulead PhotoImpact

Advantages

  • Animation supported
  • Encoding regions of particular interest
  • EXIF Header
  • Meta-data supported
  • Multipage supported
  • Transparency supported

Disadvantages

Not yet widely adopted
    Files:

    MTD

    The "Multi Texture Data" format was introduced by a cooperation of nine research institutes into "OpenSG".

    File extensions

    • .mtd

    Magic-Word

    • None

    MIME-Types

    • None

    Color modes

    • 16 bit
    • 24 bit
    • 32 bit

    Compression algorithm

    • None

    Supporting Tools

    • OpenSG

    Advantages

    • Animations supported
    • Meta-data supported
    • Mipmaps supported
    • Multipages supported
    • Transparency supported

    Disadvantages

    • Not yet widely adopted
    Files:

    NRRD

    The "Nearly Raw Raster Data" format was introduced by "Gordon Kindlmann".

    File extensions

    • .nrrd
    • .nhdr

    Magic-Word

    The number specifies the version of nrrd.

    • NRRD0001
    • NRRD0002
    • NRRD0003
    • NRRD0004
    • NRRD0005

    MIME-Types

    • None

    Color modes

    • 24 bit
    • 32 bit

    Compression algorithm

    • None
    • gzip
    • bzip2

    Supporting Tools

    Advantages (from [FLY07])

    • Simple ascii header and raw image data
    • Implemented either in single combined .nrdd file or a .nhdr header file pointing to 1 or more data files
    • Same format includes well defined way to handle complex data
    • Handles all critical metadata including spatial calibration, axis definitions (including world axes and image axes)
    • Can handle voxels considered as single points or small cubic volumes
    • Can handle arbitrary key, value tags to record additional information
    • Header can contain comment lines
    • Open source cross-platform C IO library available to link into your applications
    • Separate header files can be used to turn almost any 'raw' image file format into a Nrrd compatible file
    • Medical imaging projects such as NA-MIC have adopted nrrd format and integrated it into ITK.

    Disadvantages (from [FLY07])

    • Not yet widely adopted
    • No java wrapping of C library
    • Detached headers can lead to file clutter and possibly header info becoming separated from data file/s
    • Header is defined as ascii rather than UTF-8 so notes with accents etc. cannot officially be stored
    • Header is line based so more difficult to embed complex metadata.
    Files:

    PNG

    The "Portable Network Graphics" format was introduced by the "World Wide Web Consortium".

    File extensions

    • .png

    Magic-Word

    • .PNG

    MIME-Types

    • image/png

    Color modes

    • 1 bit
    • 2 bit
    • 4 bit
    • 8 bit
    • 16 bit
    • 24 bit
    • 32 bit
    • 48 bit
    • 64 bit

    Compression algorithm

    • None
    • DEFLATE
    • ZIP

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita
    • Microsoft Paint
    • Paint.NET
    • The GIMP
    • Ulead PhotoImpact
    • ... and many more.

    Advantages

    • Meta-data supported
    • Supported by web-browser
    • Transparency support (alpha channel, 8- or 16-bit)
    • Widely adopted

    Disadvantages

    • No animations supported
    • No multipages supported
    Image: An example of an PNG image.
    Files:

    PNM

    The "Portable AnyMap" format was introduced by "Sun Microsystems".

    File extensions

    • .pbm
    • .pgm
    • .pnm
    • .ppm

    Magic-Word

    • P1 (PBM)
    • P2 (PGM)
    • P3 (PPM)
    • P4 (PBM)
    • P5 (PGM)
    • P6 (PPM)

    MIME-Types

    • image/x-portable-pixmap (unofficial)
    • image/x-portable-graymap (unofficial)
    • image/x-portable-bitmap (unofficial)
    • image/x-portable-anymap (unofficial)

    Color modes

    • 1 bit (PBM)
    • 8 bit (PGM)
    • 24 bit (PPM)

    Compression algorithm

    There is no compression algorithm in a portable anymap.

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita
    • The GIMP
    • Ulead PhotoImpact
    • ... and many more.

    Advantages

    • Meta-data supported

    Disadvantages

    • No animations supported
    • No multipages supported
    • No transparency supported
    Files:

    PSD

    The "Photoshop Document" format was introduced by "Adobe Systems".

    File extensions

    • .psd
    • .psb
    • .pdd

    Magic-Word

    • BPS

    MIME-Types

    • image/psd
    • image/photoshop
    • image/x-photoshop

    Color modes

    • 1 bit
    • 2 bit
    • 4 bit
    • 8 bit
    • 16 bit
    • 24 bit
    • 32 bit
    • 64 bit

    Compression algorithm

    • None
    • Run-length encoding

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita (partial)
    • The GIMP
    • Ulead PhotoImpact
    • ... and many more.

    Advantages

    • Animation supported
    • Meta-data supported
    • Transparency supported
    • Widely adopted

    Disadvantages

    • No multipages supported
    Files:

    SGI

    The "Silicon Graphics Image" format was introduced by the "Silicon Graphics Inorporation".

    File extensions

    • .sgi
    • .rgb
    • .rgba
    • .int
    • .inta
    • .bw

    Magic-Word

    • None

    MIME-Types

    • image/sgi
    • image/x-sgi
    • image/x-sgi-rgba

    Color modes

    • 8 bit (black and white)
    • 16 bit (white and alpha)
    • 24 bit (3 colour channels)
    • 32 bit (3 colour channels and alpha)

    Compression algorithm

    • None
    • Run-length encoding

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita
    • The GIMP

    Advantages

    • EXIF Header
    • Meta-data supported
    • Transparency supported

    Disadvantages

    • No animations supported
    • No multipages supported
    Files:

    TGA

    The "Truevision Targa" format was introduced by "Truevision Incorporation".

    File extensions

    • .targa
    • .tga
    • .tpic

    Magic-Word

    • ...

    MIME-Types

    • image/tga

    Color modes

    • 1 bit
    • 2 bit
    • 4 bit
    • 8 bit
    • 16 bit
    • 24 bit
    • 32 bit

    Compression algorithm

    • Uncompressed, color-mapped images
    • Uncompressed, RGB images
    • Uncompressed, black and white images
    • Runlength encoded color-mapped images
    • Runlength encoded color-mapped images
    • Runlength encoded color-mapped images
    • Compressed color-mapped data, using Huffman, Delta, and runlength encoding
    • Compressed color-mapped data, using Huffman, Delta, and runlength encoding. 4-pass quadtree-type process

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita
    • Paint.NET
    • The GIMP
    • Ulead PhotoImpact
    • ... and many more.

    Advantages

    • Meta-data supported
    • Transparency supported
    • Widely adopted

    Disadvantages

    • No animations supported
    • No multipages supported
    Files:

    TIFF

    The "Tagged Image File Format" was introduced by "Adobe Systems".

    File extensions

    • .tif
    • .tiff

    Magic-Word

    • MM.* (Motorola - big endian)
    • II.* (Intel - little endian)

    MIME-Types

    • image/tiff
    • image/tiff-fx

    Color modes

    • 1 bit
    • 2 bit
    • 4 bit
    • 8 bit
    • 16 bit
    • 24 bit
    • 32 bit

    Compression algorithm

    • None
    • Lempel-Ziv-Welch
    • Run-length encoding
    • ZIP
    • other

    Supporting Tools

    • Adobe Photoshop
    • Corel Paint Shop Pro
    • Krita
    • Microsoft Paint
    • Paint.NET (partial)
    • The GIMP
    • Ulead PhotoImpact
    • ... and many more.

    Advantages

    • EXIF Header
    • Flexible and adaptable
    • Meta-data supported
    • Multipage supported
    • Transparency supported
    • Widely adopted

    Disadvantages

    • No animations supported
    Files:

    References

    [FLY07]
    :
    Flybrain@Stanford, Nrrd - image interchange format, http://flybrain.stanford.edu/nrrd

    [LIG06]
    :
    Light & Magic, Technical Introduction to OpenEXR, http://www.openexr.com/TechnicalIntroduction.pdf

Comments

This tutorial has no comments.


Add a new comment

Due to excessive spamming we have disabled the comment functionality for tutorials. Please use our forum to post any questions.