This is a pure Rust take on the classic Warcraft III BLP texture format.
No C glue, no old-school wrappers β just clean Rust that works everywhere: Windows, macOS, Linux.
It has a tiny UI made with egui β drop in a file, and boom, you can view it.
Under the hood there's a simple Rust library, perfect when you just need BLP decoding inside your own tools.
Oh, and it's part of the WarRaft toolkit β youβll also find it used together
with JASS-Tree-sitter-Rust,
which brings syntax support, analyzers, and more tooling for Warcraft III modding.
Wanna know how BLP works? Dive into the spec:
π BLP Specification
Command Line Interface
The blp tool can be built in two configurations:
- CLI-only (
--features "cli") - UI+CLI (
--features "cli ui") β the CLI plus a native GUI viewer
The UI feature always requires CLI, so ui cannot be enabled alone.
Usage
blp [PATH]
blp <COMMAND>
-
In CLI-only builds,
[PATH]performs a sanity probe: it checks whether the file is a valid BLP.- Success β exit code 0
- Failure β exit code 3
-
In UI+CLI builds,
[PATH]launches the native GUI viewer with that file (useful for βOpen Withβ¦β integration).
If a <COMMAND> is provided, it always takes precedence over [PATH].
Commands
to-blp
Convert an image into BLP format.
blp to-blp <INPUT> [OUTPUT] [OPTIONS]
<INPUT>β input file, usually a PNG[OUTPUT]β optional output path. If not specified, the extension will be replaced with.blp
Options:
-
--mips <MASK...>
Explicit mipmap mask as a sequence of 0/1 values (length 1β16).By default all mip levels are enabled.
0disables a mip level.1keeps a mip level enabled (mainly serving to position zeros).
Example:
--mips 1 0 1 1β all levels stay enabled except the second one, which is disabled. -
--mips-limit <N>
Limit the number of generated mip levels (1β16).
All levels afterNare forced tofalse, overriding--mipsif both are given. -
-q, --quality <Q>
JPEG quality (1β100).
Default: 100.
to-png
Convert a BLP texture into PNG format.
blp to-png <INPUT> [OUTPUT]
<INPUT>β input file, must be BLP[OUTPUT]β optional output path. If not specified, the extension will be replaced with.png
Examples
Check if a BLP file is valid (CLI-only):
Convert PNG to BLP with a custom mip mask:
# disables only the second mip level, all others remain enabled
# keeps only mip levels: 1 (base), 2, 3, 4
# disables levels: 5β16 (if they would exist)
# equivalent to: --mips 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Convert BLP to PNG:
Open BLP in GUI (UI+CLI build):
Localization
All localization files are stored in assets/locales.
You are welcome to contribute a translation in your own language using whatever workflow is most convenient for you, and
I will include it in the program.
It is not required to translate every key: any missing strings will automatically fall back to the default English (
en) localization. This means you can start small and expand the translation over time without breaking anything.