什么是 XBM?X 位图格式解析

XBM(X位图)是单色X Window系统图像格式,将1位位图存储为可编译的C源代码,用于图标和光标。

免费在线文件转换工具。在 Windows、macOS、Linux、Android 和 iOS 上的 Chrome、Firefox、Safari、Edge、Opera 及其他现代浏览器中运行。无需安装软件或注册。所有转换都直接在您的浏览器中进行,因此您的文件不会离开您的设备。免费使用,无需账户。

Image

什么是 XBM?X 位图格式解析

一种以可编译 C 源代码存储的单色 X Window System 位图格式。

最后更新:

Year1980s
TypeRaster (monochrome)
UsageX Window System icons

What is it?

XBM (X BitMap) is a monochrome image format used by the X Window System to store simple bitmaps such as icons and cursors. Its defining characteristic is that an XBM file is plain C source code rather than a conventional binary image file.

An XBM file consists of #define statements giving the width and height in pixels, followed by a static array of unsigned char values holding the 1-bit pixel data. Each byte encodes eight pixels, with the upper-left pixel in the low bit of the first byte. Because it is valid C, an XBM bitmap can be compiled directly into an application.

Technical Specifications

DeveloperX Window System (MIT / X Consortium)
File Extension.xbm
MIME Typeimage/x-xbitmap
Released1980s (with X Window System)
Type1-bit monochrome bitmap (C source)

Pros & Cons

Advantages

直接编译成代码

Because an XBM file is C source, the bitmap can be #included and compiled straight into an application with no separate loader.

可读且可编辑

The plain-text array can be inspected and edited in any text editor, which is convenient for tiny icons.

结构非常简单

With just width/height defines and a byte array, XBM is trivial to generate and parse programmatically.

适合小图形的轻量级

For small monochrome icons and cursors, XBM is a compact and dependency-free way to embed images.

Disadvantages

仅支持单色

XBM stores only 1-bit black-and-white pixels, with no support for grayscale or color.

存储效率低

Encoding each byte as ASCII C hexadecimal makes files far larger than the raw pixel data they represent.

在很大程度上被取代

XBM was superseded by XPM for color, and is now used mainly for simple UI elements in lightweight window managers.

When to Use It

XBM is used for small monochrome graphics within the X Window System and similar contexts.

X Window 图标和光标

XBM was the original format for cursor and icon bitmaps in the X GUI environment.

嵌入式 UI 按钮图像

Lightweight window managers such as Openbox still use XBM to define simple title-bar buttons like minimize and maximize.

编译的图形

Developers embed small monochrome bitmaps directly into C programs by including XBM source files.

How to open a XBM file

XBM files, or X BitMap files, are primarily used for storing bitmap images in a format that is particularly suited for X Window System applications. Software for handling XBM files can be categorized into professional graphic design tools, free and open-source applications, web-based viewers, and built-in system utilities. Professional tools are ideal for users needing advanced editing capabilities, while free and open-source options are great for casual users or developers looking for cost-effective solutions.

When selecting software for XBM, important decision factors include the fidelity of the image handling, whether the user needs editing capabilities or just viewing, and the cost model of the software. Additionally, platform compatibility is crucial, as some tools may only be available on specific operating systems. Users may also consider export needs, as converting XBM to other formats could be more efficient depending on the intended use.

GIMP 2.10.34

Windows, macOS, LinuxFree (GPL)

GIMP is a powerful open-source image editor that supports XBM files for both viewing and editing. It offers high fidelity in handling XBM graphics, allowing users to manipulate pixel data directly.

主要功能
  • Advanced layer and mask editing
  • Customizable brushes and tools
  • Support for various image formats
  • Image scaling and transformation tools
  • Scripting support for automation
优点
  • Comprehensive editing capabilities for XBM
  • Strong community support and plugins
  • Cross-platform availability
局限
  • Steeper learning curve for beginners
  • Performance can lag on large files

可导出为: PNG, JPG, TIFF, BMP, GIF

适合: GIMP is ideal for users needing robust editing features for XBM files without the cost.

访问 GIMP →

ImageMagick 7.1.0-15

Windows, macOS, LinuxFree (Apache License)

ImageMagick is a command-line tool that excels in converting and manipulating images, including XBM files. It is particularly useful for batch processing and automation of image tasks.

主要功能
  • Batch conversion of XBM files
  • Image resizing and cropping
  • Format conversion capabilities
  • Text and drawing capabilities
  • Image filtering and effects
优点
  • Powerful batch processing capabilities
  • Extensive format support
  • Highly scriptable for automation
局限
  • Command-line interface may intimidate users
  • Limited GUI options for casual users

可导出为: PNG, JPG, GIF, TIFF, PDF

适合: ImageMagick is best for users who need to automate and process XBM files in bulk.

访问 ImageMagick →

XnView MP 1.0.0

Windows, macOS, LinuxFree / Paid

XnView MP is a versatile image viewer and converter that supports XBM files, allowing users to view and convert images easily. It provides a user-friendly interface with a range of features for managing image collections.

主要功能
  • Multi-format image viewing
  • Batch conversion and renaming
  • Image metadata editing
  • Slideshow and presentation options
  • Basic image editing tools
优点
  • User-friendly interface for viewing XBM
  • Supports a wide range of formats
  • Efficient batch processing features
局限
  • Limited advanced editing capabilities
  • Some features require paid version

可导出为: PNG, JPG, TIFF, BMP, GIF

适合: XnView MP is suitable for users looking for an easy-to-use viewer and converter for XBM files.

访问 XnView MP →

Adobe Photoshop 2023

Windows, macOS$20.99/mo

Adobe Photoshop is a leading professional image editing software that can open and edit XBM files, providing extensive tools for detailed graphic design work. Its high fidelity and advanced features make it suitable for professional use.

主要功能
  • Full layer and mask editing
  • Advanced color management tools
  • Extensive brush and tool customization
  • Smart Objects and vector shapes
  • Support for 3D graphics and animation
优点
  • Industry-standard editing capabilities
  • Robust support for various formats
  • Extensive resources and tutorials available
局限
  • Subscription cost may be prohibitive
  • Complex interface for new users

可导出为: PNG, JPG, TIFF, PDF, GIF

适合: Adobe Photoshop is perfect for professionals needing comprehensive editing tools for XBM files.

访问 Adobe Photoshop →

Convert XBM Files Free

Use our free online converter to convert XBM and other formats - no signup, no watermarks.

Try Image Converter Free

References

  1. X BitMap - Wikipedia
  2. X PixMap - Wikipedia