XBM Mask Generator
Use this tool to create an XBM (X Bitmap) mask file from a GIF or PNG image with
transparent pixels. An XBM mask is necessary for Perl/Tk programs if you want
the window icon to have transparency in it.
About This Program
The XBM Mask Generator is a web-based tool for creating XBM
mask files, specifically for use within Perl Tk. See the tutorial
Perl/Tk Transparent Icons
for more information.
About X BitMaps
X BitMap (XBM) images are an ASCII-based monochrome image format used by the
X Window System for storing cursor and icon bitmaps. An XBM image has only two
colors: white and black. For an XBM Mask, black pixels indicate parts of the
source image that are solid, and white pixels are parts that are transparent.
Having said that, animated GIFs will not work. If you upload one, only the first
frame of the GIF will be used.
Learn more about X BitMaps at
Requirements and Restrictions:
- Upload the GIF or PNG image that you want to use as your Perl/Tk
window icon. The image must have transparent pixels (otherwise
the masking is pointless) and has to be an indexed-color image
(truecolor images aren't allowed).
- Click on "Create Mask Image". If your image meets the requirements
outlined below, a temporary download directory will be created
and you will be presented with a link to the XBM file that was
generated for you. You can then download your XBM image and use
it in your Perl/Tk program. See the tutorial linked to above for
more information about how to use your XBM image.
- Your image must be of the GIF or PNG format.
- These are the two major formats that support
- Your image must be using an indexed-color palette.
- Indexed-color images typically have a palette of
256 colors, with one color in the palette optionally
- Perl/Tk will crash if you try to set a truecolor
PNG image with alpha channels as your window's icon.
Therefore, indexed-color palettes are enforced within
this generator to avoid the complexity of alpha channels.
- Your image must be less than 1 MB in size and smaller than 256x256 pixels.
- This generator does not automatically
scale down your image into icon size (32x32 pixels). It is
up to you to format your icon ahead of time. This generator
will only accept a total of 1 MB of data and to reduce processor
cycles, your image can be a maximum of 256x256 pixels in size.
Casey Kirsle © 2009