Back to Home 100% Free

Pic to WBMP Converter

Convert PNG, JPG, and other formats to 1-bit X Bitmap (XBM) C-source images offline.

Drag & Drop Your Images Here

Supports PNG, JPG, WEBP, GIF, BMP, SVG, TIFF (Max 20MB per file)

Transformation Settings

Width (px)
Height (px)

Monochrome formats like WBMP do not support alpha transparency. Transparent pixels will be filled with this solid background color.

B&W Threshold 128

Adjust threshold to change black and white density. Shifting left makes it lighter; shifting right makes it darker.

Understanding the X Bitmap (XBM) File Format Structure

The X Bitmap (XBM) is a 1-bit monochrome raster graphics format stored as C source code, older cellular systems, and micro-display hardware. Optimized for extremely use in the X Window System, storing bitmap data in hexadecimal arrays 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 byte 0x00).
  • Fixed Header: A reserved WAP parameter byte, which is always 0 (represented as 0x00).
  • 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 0 represents a black pixel and 1 represents 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 0 bits.

C-Style Structuring: XBM as a C Header File

Unlike binary formats, XBM files are valid C source headers defining variables for width, height, and bits (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 to 0, 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:

Gray = round(0.299 * Red + 0.587 * Green + 0.114 * Blue)

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 XBM 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 XBM 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.

XBM Specifications

MIME Type

image/x-xbitmap

Bit Depth

1 bit per pixel. `0` = Black, `1` = White.

Header Parameters

Type 0 (Monochrome), Fixed Header 0, followed by VLQ width and height.

Padding Format

Each row is bit-packed MSB-first and padded with `0` bits to byte boundary.

Why XBM?

XBM is highly popular in C/C++ embedded programming and legacy UNIX GUI applications. Because XBM files are compiled directly into the executable as binary arrays, they require no external image decoding libraries..

Frequently Asked Questions

What is an XBM image file?

WBMP stands for X Bitmap (or Wireless Bitmap). It is a monochrome raster format optimized for resource-constrained mobile devices and microcontrollers, storing pure black-and-white pixels.

How does XBM store pixel bits?

XBM packs 8 pixels per byte, LSB-first. A bit value of 1 represents foreground (black) and 0 represents background (white)..

What is uintvar VLQ dimension encoding?

It is a base-128 Variable Length Quantity integer encoding. Each byte uses 7 bits for the numerical value, and the MSB (eighth bit) as a continuation flag. This ensures dimension attributes use the minimal number of bytes in the header block.

Does XBM support transparent layers?

No. XBM does not support transparency. Alpha channels in PNG or WEBP uploads are flattened against a chosen Solid Background fill color before thresholding.

Is the XBM converter safe and private?

Yes. Our converter performs all pixel math entirely on the client side in your web browser. No files are uploaded to cloud servers, ensuring full data privacy.

How can I open an XBM file?

XBM files can be opened by standard image editors like GIMP or Aseprite, and can be viewed directly in web browsers like Firefox/IE or read in any text editor. In C/C++ projects, you can include them directly using #include.

Mascot assistant is ready!