Blp2 Format Guideline

Blp2 is a proprietary texture format used by several games including Blizzard's World of Warcraft and Warcraft III. It is the succesor to Blp1 and Blp0 used in older games. The format serves as a container for several texture compressions.

The structure of the file consists of a header containing meta data with information like image dimensions and compression types, followed by a color palette and the actual image data. Most texture compressions don't make use of the palette. Regardless of that fact it is always present.

To make the optimal decision for which settings to use for conversion of your original image you should read the following:

Texture data

The texture data can be stored in a variety of formats of which the following are used within World of Warcraft:

Dxt

S3 texture compression (DxtN) is a set of lossy, but fast compression algorithms used in many games that is built into Microsoft's DirectX. Most World of Warcraft textures use one of these formats. The basic principle behind the compression is to choose 2 optimal colors out of 4 input pixels and store a lookup table determining which color is used for each of the 4 pixels when decompressed.

One reason for potential quality loss is the color storage itself. 16bpp RGB565 values (meaning 5 bits red, 6 bits green, 5 bits blue) are stored with Dxt compression resulting in 65.536 possible colors whereas s typical TrueColor image with 24bpp (8 red, 8 green, 8 blue) allows up to 16.7 million colors. This could be noticed if your image contains, say mostly shades of red as there are not as much nuances of red, green and blue as in a TrueColor file.

The compression ratio is either 4:1 or 8:1 depending on the Dxt version. The variations of Dxt compressions differ primarily in the handling of alpha data. Therefore the choice of a Dxt variation should be made depending on your image's transparency. Below is comparison table with recommendations based on your original alpha data characteristics:

Color
Depth
No
Alpha
1bit
Alpha
4bit
Alpha
8bit
Alpha
Good for
DXT1 16bpp Y Y N N No or 1bit transparency
(Either fully transparent or opaque)
DXT3 16bpp N N Y Explicit Sharp transparency
DXT5 16bpp N N N Interpolated Gradient transparency

Uncompressed

Uncompressed textures have an excellent quality but result in big files, which require more memory. There are two supported uncompressed texture types in World of Warcraft: Raw1 and Raw3.

Raw3 stores full RGBA informations for each pixel. This kind of textures easily exceeds many Megabytes for large images but has no quality loss at all.

Raw1 textures have a fixed table of 256 colors similar to a Gif image. While this program uses high quality NeuQuant color quantization Raw1 images tend to look better for images with lesser unique colors. Again this type is not optimal storage wise yet only half as big as Raw3 (32bpp RGBA vs 16bpp Index + A). You can further improve the quality of Raw1 output with the dithering option. Dithering is is a technique where pixels with colors not available in the color table are approximated by diffusing nearby pixels. The human eye perceives those pixel patterns as a mixture of colors so that hard edges are avoided.

Mipmaps

Mipmapping is the process of attaching several smaller versions of a texture to the file. Because interpolation in games, especially in 3d engines, needs to be a fast process the algorithms used therefor suffer from bad quality. To counter this problem pre-rendered mipmaps are created so that costly and high quality interpolation is done during the process of texture conversion. The application using the texture picks the mipmap based on the projected size. Textures that are never scaled (like in user interfaces) don't need mipmaps per se so you can decrase the filesize for that purpose.

Texture dimensions

Texture sizes of Blps must be powers of 2 (1, 2, 4, 8, 16 etc.). Otherwise they won't be displayed. The program offers 4 resize methods to ensure that the source image has the right size: Crop, Extend, Shrink and Stretch.