forked from jetelain/bis-file-formats
-
Notifications
You must be signed in to change notification settings - Fork 0
PAA Encoder
Matthew Barker edited this page Jun 14, 2026
·
1 revision
DXT1/DXT5 PAA texture encoding with mipmap generation. Converts source images (PNG, BMP, etc.) into PAA format textures suitable for Arma 3.
Depends on: BIS.PAA, BCnEncoder.Net
The PAA encoder takes standard image formats and produces PAA files with
DXT1 or DXT5 compression, automatically generating a full mip chain.
This is the reverse of the BIS.PAA module's decoding pipeline.
| Type | Description |
|---|---|
PaaEncoder |
Main encoding class — accepts images and produces PAA byte arrays |
EncodingOptions |
Configuration for encoding (format, mipmap settings, quality) |
| Type | Description |
|---|---|
DxtCompressionType |
DXT1 or DXT5 |
MipmapGeneration |
Controls mip chain generation (auto, none, custom) |
// Encode a PNG file to PAA
var encoder = new PaaEncoder();
byte[] paaData = encoder.EncodeFromFile("input.png", DxtCompressionType.DXT5);
File.WriteAllBytes("output.paa", paaData);
// Encode from a stream
using var stream = File.OpenRead("input.png");
byte[] paaData2 = encoder.EncodeFromStream(stream, DxtCompressionType.DXT1);
// With custom options
var options = new EncodingOptions
{
CompressionType = DxtCompressionType.DXT5,
GenerateMipMaps = true,
MaxMipMapSize = 512,
};
byte[] paaData3 = encoder.EncodeFromFile("input.png", options);| Source Format | Recommended Target | Notes |
|---|---|---|
| Photographs / diffuse maps | DXT5 | Better colour + alpha quality |
| Colour with 1-bit alpha | DXT1 | Smaller, sufficient for trails/mask |
| Normal maps | DXT5 (with swizzle) | Preserves normal vector precision |
| Interface / UI | DXT1 or DXT5 | Depends on alpha requirements |
No dedicated test data directory for encoding — the encoder tests in
BIS.PAA.Encoder.Test generate their own test images programmatically
and verify the round-trip through BIS.PAA decoding.