BLP File Format

Source: Internet
Author: User
Tags blizzard

. BLPFiles are texture files used in games made by Blizzard Entertainment, also used in other games like Neverwinter Nights. While blizzard provides an interface addon kit for extracting the user interface files fromWorld of Warcraft. Mpqs, they do not provide a utility to view the. BLP files contained within. Also,. BLP graphics were used for Warcraft III, and are also stored within. mpqs.

Format
The file starts with a proprietary header, followed by the texture data. the texture data are typically stored in dxt1, dxt3, uncompressed or possibly dxt5. it is important to note that the size of the image is a power of 2.

Converters

Several third party applications exist that can convert. BLP files to. TGA files and vice versa. Some of the programs were madeWarcraft IIITextures, however, and don't work for all Blizzard game textures. These converters have become very important toWarcraft IIIModding community, and have been the doorway to the vast amount of customised skins available for download.

Specification

Note that all types are little-Endian.
Only the blp2 format is shown here; For the blp1 format, refer to BLP version 1 format specifications

Blp2 format

Struct blp2header <br/>{< br/> fourcc ID; // always 'blp2' <br/> uint32 type; <br/> uint8 encoding; <br/> uint8 alphadepth; <br/> uint8 alphaencoding; <br/> uint8 hasmips; <br/> uint32 width; <br/> uint32 height; <br/> uint32 offsets [16]; <br/> uint32 lengths [16]; <br/> rgbacolor8 palette [256]; <br/> };

Type
0: JPEG compression
1: Uncompressed or DirectX Compression

Encoding
1: Uncompressed
2: DirectX Compression

Alphadepth
0: no alpha channel
1: 1 bit Alpha
8: 8 bit Alpha

Alphaencoding
0: dxt1 alpha (0 or 1 bit Alpha)
1: dxt2/3 alpha (4 bit Alpha)
7: dxt4/5 alpha (interpolated alpha)

Hasmips
0: No MIP levels
1: MIP levels present (the number of levels is determined by the image size)

Width, height: Dimensions of the image in pixels (always a power of two)

Offsets [0]: Offset from the start of the file to the image data
Lengths [0]: Length in bytes of the image data
Palette: 4-byte bgra color values for paletted textures (This field is present regardless of whether the texture actually uses palettes

Type 1 encoding 1 alphadepth 0 (uncompressed paletted image with no alpha)

Each byte of the image data is an index into palette which contains the actual RGB value for the pixel. although the palette entries are 32-bits, the Alpha value of each palette entry may contain garbage and shoshould be discarded.

Type 1 encoding 1 alphadepth 1 (uncompressed paletted image with 1-bit Alpha)

This is the same as type 1 encoding 1 alphadepth 0 blocks t that immediately following the index array is a second Image array containing 1-bit Alpha values for each pixel. the first byte of the array is for pixels 0 through 7, the second byte for pixels 8 through 15 and so on. bit 0 of each byte corresponds to the first pixel (leftmost) in the group, bit 7 to the rightmost. A set bit indicates the pixel is opaque while a zero bit indicates a transparent pixel.

Type 1 encoding 1 alphadepth 8 (uncompressed paletted image with 8-bit Alpha)

This is the same as type 1 encoding 1 alphadepth 0 blocks t that immediately following the index array is a second Image array containing the actual 8-bit Alpha values for each pixel. this second array starts at blp2header. offset [0] + blp2header. width * blp2header. height.

Type 1 encoding 2 alphadepth 0 (Dxt1No alpha)

The image data are formatted using dxt1 compression with no alpha channel.

Type 1 encoding 2 alphadepth 1 (Dxt1One bit Alpha)

The image data are formatted using dxt1 compression with a one-bit alpha channel.

Type 1 encoding 2 alphadepth 8 alphaencoding 1 (Dxt3)

The image data are formatted using dxt3 compression.

Type 1 encoding 2 alphadepth 8 alphaencoding 7 (Dxt5)

The image data are formatted using dxt5 compression.

External links

  • . BLP to. TGA (and vice versa) converter for Mac OS X
  • . BLP Viewer (for World of Warcraft BLPs) for Mac OS X
  • Xnview graphic file browser for Windows OS that also handles. BLP files
  • The hive workshop's skin database, currently at over 2300Warcraft IIISkins.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.