Welcome to Open Carnage

A resource for Halo 1 modding and tech, with unique means of rewarding individual content creation and support. Have a wander to see why we're worth the time! EST. 2012

Sign in to follow this  
Followers 0
Kavawuvi

Bitmap formats

With invader-bitmap now supporting every bitmap format, I felt it was worth writing a small guide on the different bitmap formats.

 

If you want a quick technical overview as well as some tips, I recommend looking at Shelly's spreadsheet, instead: https://docs.google.com/spreadsheets/d/18ZBzUGmH8F3bqB2-0dPa9nnOtVl_liT1cnNLZaHn92c/edit?usp=sharing

 

Meet the Formats

When making a .bitmap tag, there are a few types of bitmap formats you can choose in Guerilla/Mozzarilla:

  • "compressed with color-key transparency" or "dxt1" in invader-bitmap
  • "compressed with explicit alpha" or "dxt3" in invader-bitmap
  • "compressed with interpolated alpha" or "dxt5" in invader-bitmap
  • "16-bit color" or "16-bit" in invader-bitmap
  • "32-bit color" or "32-bit" in invader-bitmap
  • "monochrome" (same name in invader-bitmap)

There is a seventh option, but it it is only available for height maps if "disable height map compression" is not checked. This is called "P8 bump" which I'll talk about in a bit. For now, I'm going to talk about the file size limits as well as the compressed and uncompressed formats you can select manually.

 

File Size Limits
There are limitations when it comes to file size:

  • Stock, unpatched tool.exe, limits to 384 MiB, while also resulting in issues with loading the map in Halo once you reach 128 MiB. Invader or a patched tool.exe is required for maps that exceed these limits.
  • Stock, unpatched tool.exe cannot process textures larger than 16 MiB. Invader or a patched tool.exe is required for maps that exceed this limit.
  • Halo is limited to 2 GiB of virtual memory. Even if LAA patched, Halo will still be limited due to being a 32-bit process.

The primary reason for choosing formats is for space considerations. If you use 32-bit color for every bitmap, you will get the best quality, but the file size may be larger. If you use DXT for every bitmap, you will get the best file sizes but worse quality bitmaps.

 

Uncompressed formats
These formats all use explicit alpha and RGB. By explicit, I mean that each pixel's red/green/blue/alpha values are individually defined in the texture rather than being inferred from a set of interpolated colors/alphas.

 

32-bit
This format is a no compromise format. You get the best image quality, but you also get the largest images due to each pixel taking up 32 bits. As a result, many of the stock textures are not 32-bit, and the game looks much better when re-making them in 32-bit. To put it in perspective, a 2048x2048 bitmap without mipmaps is 16 MiB - the maximum size bitmap tool.exe supports. With mipmaps, it exceeds that at over 21 MiB. This is the default format for newly created bitmaps in invader-bitmap.


Pros

  • Best image quality
  • Explicit alpha
  • Explicit RGB

Cons

  • Highest file size
  • Environment maps require a mod (i.e. Chimera 1.0) to fix a bug of Halo making explosions blue

Subformats

  • A8R8G8B8 - 32-bit with alpha - This is used if not all pixels have 100% alpha.
  • X8R8G8B8 - 32-bit without alpha - This is used if all pixels have 100% alpha, thus the alpha channel is ignored. tool.exe will also choose this if all pixels have 0% alpha, so be careful if you use tool.exe for 32-bit color.

 

16-bit
This format is half the size of 32-bit, but it also has less color depth. Having an alpha channel further reduces color depth, with 1-bit alpha reducing color depth significantly less than 4-bit alpha. So, as a result, you can get banding with gradients. This banding can be improved with dithering, however.

 

Pros

  • Half the size of 32-bit
  • Explicit alpha
  • Explicit RGB

Cons

  • Somewhat reduced color depth
  • Banding in gradients

Subformats

  • R5G6B5 - 16-bit without alpha - This is used if not all pixels have 100% alpha.
  • A1R5G5B5 - 16-bit with 1-bit alpha - This is used if all pixels are either 100% alpha or 0% alpha. The green channel has half the color depth vs. R5G6B5.
  • A4R4G4B4 - 16-bit with 4-bit alpha - This is used if there are pixels that don't have 100% alpha or 0% alpha. All channels have half the color depth vs. A1R5G5B5, with green having a quarter of the color depth vs. R5G6B5.

 

Monochrome
This format can be either 8-bit or 16-bit. If only alpha is defined and each pixel has an intensity of 100%, or only intensity is defined and each pixel has an alpha of 100%, then it is 8-bit. Otherwise, if intensity and alpha are separately defined, it's 16-bit. This is perfect for things like HUDs and HUD icons, as it results in no loss in quality. By intensity, I mean red = green = blue = intensity, thus it is grayscale. Sadly, this format does not work with stock Halo PC, requiring a mod (i.e. Chimera).

 

Pros

  • No loss in image quality for grayscale input
  • Half the size of 32-bit OR half the size of 16-bit
  • Explicit alpha
  • Explicit RGB

Cons

  • Does not work with Halo PC without a mod (i.e. Chimera 1.0)

Subformats

  • A8 - 8-bit alpha - This is used if all pixels have 100% intensity.
  • Y8 - 8-bit intensity - This is used if all pixels have 100% alpha. Alpha equals 100%.
  • A8Y8 - 8-bit alpha + 8-bit intensity - This is used if pixels have varying alpha AND intensity.

 

Compressed formats
The DXTn formats are compressed in 4x4 blocks. These 4x4 blocks each have two 16-bit (R5G6B5) colors chosen by the compressor, and these colors are interpolated at runtime. As a result, different implementations can have slightly different results, and there is some loss in quality. Note that all of these formats store color exactly the same. Having a better compressor can result in better quality bitmaps (or more accurately, less reduced quality bitmaps), but it will almost always have some sort of loss in quality - often times significant.

 

DXT1
This format stores only color and no alpha, instead being color-keyed. As a result, it is the smallest format, at 64 bits per block (4 bits per pixel). Since these formats all store color the same, if you use DXT3 or DXT5 and you have no alpha channel, DXT1 will be used, instead, to save space. This is the default format for newly created bitmaps with tool.exe.


Pros

  • 1/4th the size of 16-bit

Cons

  • No alpha channel; alpha is color-keyed instead
  • Can have significant loss in quality
  • Can have banding between blocks
  • Cannot go below 4x4 or have mipmaps less than 4x4 resolution
  • Less color depth than 32-bit (not including the interpolated colors which depends on implementation)

 

DXT3
This format stores color as well as explicitly storing alpha in 4-bits per pixel, thus making it 128 bits per block (8 bits per pixel). Since alpha is explicit, shapes are preserved, making it arguably better than DXT5 for things like HUD elements.


Pros

  • Half the size of 16-bit
  • Explicit alpha

Cons

  • Can have RGB banding between blocks
  • Banding in alpha gradients
  • Cannot go below 4x4 or have mipmaps less than 4x4 resolution
  • Less color depth than 32-bit (not including the interpolated colors which depends on implementation)

 

DXT5
This format interpolates both color and alpha. It is also 128 bits per block (8 bits per pixel). Since alpha is interpolated, gradients won't suffer from banding within blocks, but they may have fuzzier outlines.


Pros

  • Half the size of 16-bit

Cons

  • Can have banding between blocks
  • Cannot go below 4x4 or have mipmaps less than 4x4 resolution
  • Less color depth than 32-bit (not including the interpolated colors which depends on implementation)

 

P8
Rather than compressing in 4x4 blocks, the image is converted into a 256-color indexed bitmap suitable for height maps but not really anything else. tool.exe and invader-bitmap use different palettes, as invader-bitmap uses the more superior Stubbs palette.

 

Pros

  • Half the size of 16-bit
  • Each pixel explicitly chooses a color from a palette

Cons

  • Does not work with Halo PC without a mod (i.e. Chimera 1.0)
  • Significant banding in gradients
  • Color palette depends on implementation

 

What is the best format for me?

If you are not concerned about size, 32-bit is the way to go. It provides the best quality, being noticeably better than any of the other formats.

 

16-bit provides a nice middle ground, especially if you use dithering. DXT1/3/5, on the other hand, are for if/when you want to keep file size down. If you use this format, it is recommended you use the best compressor possible so you have the least amount of quality reduced. The compressor invader-bitmap uses is better than tool.exe's compressor, but it isn't as good as Nvidia's compressor.

UGZWSYP.png

 

If you want your map to work with stock Halo PC, then you obviously cannot use P8 or monochrome. This is a shame, because monochrome is, objectively, the best format for things like HUDs as it provides no quality loss, while, although P8 isn't perfect, it's fine for bumpmaps.

Share this post


Link to post
Share on other sites

Members of Open Carnage never see off-site ads.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.