Understanding the Wireless Bitmap (WBMP) File Format Structure
The Wireless Application Protocol Bitmap (WBMP) is a mobile-focused monochrome (1-bit) raster graphics format designed specifically for WAP-enabled mobile devices, older cellular systems, and micro-display hardware. Optimized for extremely low-bandwidth networks, WBMP uses a minimal header and variable-length encoding to maximize data compression. A WBMP file is structured as follows:
- Type: A Variable Length Quantity (VLQ / `uintvar`) byte identifying the image type. For standard monochrome bitmaps, this is always
0(represented as a single byte0x00). - Fixed Header: A reserved WAP parameter byte, which is always
0(represented as0x00). - Width & Height: Multi-byte integer properties encoded in Variable Length Quantity (VLQ). Values under 128 utilize 1 byte, while larger values expand dynamically.
- Monochrome Bit Coding: Unlike PBM, in the WBMP format, a bit value of
0represents a black pixel and1represents a white pixel. - Pixel Data: Raw packed bits (8 pixels per byte, MSB-first). Each row must be padded to the byte boundary with trailing
0bits.
VLQ uintvar Integer Packing: How WBMP Encodes Dimensions
To maintain absolute minimum file size constraints, WBMP uses WAP **uintvar** variable-length coding (also called base-128 or VLQ encoding) to pack integers:
- Numbers are broken down into groups of 7 bits, ordered most significant group first.
- The eighth bit (the Most Significant Bit, or MSB) of each byte serves as a continuation flag.
- If the MSB is set to
1, it signals that another byte follows. If it is set to0, it marks the end of the integer value. - This allows a small display (e.g., 96x64 pixels) to occupy only 1 byte per dimension in the header, while supporting larger dimensions automatically.
Grayscale Thresholding: The Cutoff Logic
When uploading modern full-color photos (PNG, JPG, WEBP), color channels must be flattened. The converter first maps RGB pixels to gray values via standard luminosity calculation:
The resulting grayscale shade (0 to 255) is compared against the user-specified **B&W Threshold slider**. If the gray value is lower than the threshold, the pixel is mapped to black (value 0); otherwise, it is converted to white (value 1). Adjusting the slider enables you to capture precise outlines of high-contrast text, QR codes, icons, and diagrams.
Actionable WBMP Integration & Best Practices Checklist
1. Keep Dimensions Compatible
If compiling for legacy cellular systems or retro displays (like Nokia WAP tools or Arduino OLEDs), verify the maximum hardware buffer size beforehand.
2. Fill Alpha Channels Prior to Conversion
Since WBMP lacks alpha transparency channels, adjust the solid backdrop fill color picker in the settings panel to ensure logos or text remain visible after transparency flattening.
3. Optimize Contrast via Previews
Fine-tune the threshold cutoff slider. Sliding left lightens the image (less black), while sliding right deepens shadows (more black).
4. Secure Local Execution
Our converter processes files 100% locally. No image data is sent to external databases, providing complete privacy.
WBMP Specifications
image/vnd.wap.wbmp
1 bit per pixel. `0` = Black, `1` = White.
Type 0 (Monochrome), Fixed Header 0, followed by VLQ width and height.
Each row is bit-packed MSB-first and padded with `0` bits to byte boundary.
Why WBMP?
WBMP is historically significant for mobile devices and remains highly popular in embedded electronics development. Its minimal byte overhead makes it ideal for transmitting pictures over low-speed serial connections to LCDs.