This article contains the answers to some Frequently Asked Questions about the XPM format and/or library. If you don't find the answer to your problem here, then you can mail either to [email protected] or to the mailing list [email protected].
Netpbm is surely the best image conversion package that I know of. It defines formats for color, gray and monochrome images and provides a set of filters. Thus a GIF image can be converted to XPM with something like:
$ giftoppm youricon.gif | ppmtoxpm > youricon.xpm
The latest release can be found at least from wuarchive.wustl.edu (128.252.135.4), directory /graphics/graphics/packages/NetPBM
There are three official versions of the XPM format. The XPM library since version 3.3 can read all them but writes out only XPM 3. Also the small program called sxpm which is part of the XPM library package can be used to automatically translate XPM 1 and 2 files to XPM 3 with a command such as:
$ sxpm -nod yourxpm1or2file -o yourxpm3file
Also, the XPM format defines "None" to be the color name meaning "transparent", but IXI used to hack the XPM library in its early days to handle transparency as "#Transparent". This makes IXI format not compatible with the official XPM format, and so not readable neither by the official XPM library nor any of the programs built on top of it.
The only solutions are either to stick on IXI programs which can deal with their format or convert your files to the standard XPM format. This can be done simply by changing "#Transparent" to "None".
Be sure the XpmAttributes structure you pass by reference has a valid valuemask. You can give NULL instead if you don't want to use an XpmAttributes but if you do, you MUST initialize its valuemask component to some valid value, at least 0, otherwise unpredictable errors can occur.
So instead of doing something like:
XpmAttributes attrib; XpmReadFileToPixmap(dpy, d, filename, &pixmap, &mask, &attrib);
you should do:
XpmAttributes attrib; attrib.valuemask = 0; XpmReadFileToPixmap(dpy, d, filename, &pixmap, &mask, &attrib);
The X Window System does not support transparent color. However there are several ways you can use to get the same visual effect using XPM:
Basically a mask is created if "None" is used as one of the color of the pixmap. Be aware that this is not only true if it is used in the XPM of the pixmap since the colors can be overridden at load time. So a mask is created if the "None" color is used at load time, coming either from the XPM definition or the color overriding.
There are basically two ways of using the mask:
Yes, Motif 2.0 or later does support XPM pixmaps as well as XBM bitmaps.
As listed below several editors either commercial or not are supporting the XPM format. However, pixmap is the one I would recommend since it is freely available and, being fully dedicated to XPM, it allows to edit all the special things, such as the symbolic color names, which makes XPM different from all the other image formats. Pixmap can always be found by ftp from ftp.x.org (contrib) and avahi.inria.fr (pub/pixmap).
Last Update: 3 August 1994
Program | Infos | Source/Author | Platforms | SA | XPM | cost |
---|---|---|---|---|---|---|
pixmap |
| Lionel Mallet | source | yes | 3 | NC |
pixt |
| J. Michael Flanery | source | yes | 1 | NC |
pixed |
| IXI | Many UNIX | no | 3 | N/A |
olpixmap |
| USL | Sun, SVR4.2, UnixWare | no | 1 | N/A |
xfedor |
| Daniel Dardailler | source | yes | 3 | NC |
SCOpaint |
| SCO/Wing Eng | ODT | yes | 2.8 | N/A |
pme.icn |
| Icon Project | source | yes | 3 | NC |
PixEditT |
| Free Widget Foundation | source | yes | 3 | NC |
xscribble |
| Robert Forsman | source | yes | ? | NC |
vueicon |
| Hewlett-Packard | HP | yes | 3 | N/A |
iconedit V3 | SunSoft | Sparc/Sun3 | yes | 2 | N/A | |
Pixmap Editor |
| ICS | ? | yes | ? | ? |
ezX | Sunrise Softwarey | ? | ? | ? | N/A | |
XPaint |
| David Koblas | source | yes | 3 | NC |
Phoenix |
| [email protected] | source | yes | 3 | NC |
pixed |
| Alsys | Many UNIX | yes | 3 | N/A |
display |
| John Cristy | source | yes | 3 | NC |
SA - Stand Alone program
NC - No Charge (i.e. free); most programs are copyrighted.
XPM - XPM format supported
source - built from source code; likely works on all standard X platforms
N/A - icon editor is normally distributed with other software
Send updates, additions, corrections, etc. to [email protected]
At least there is one freely available: Anthony's X Icon Library. You can found it on several ftp servers, such as server.berkeley.edu/pub/AIcons. It contains only small icons (less than about 100x100 pixels in size) which are stored in groups in a logical way. Color icons are stored in XPM format and Black & White icons in XBM.
The PostScript documentation file is formatted for US letter paper. Frame Maker tries very hard to ensure that you have the right paper and punts if you don't. However, you can easily work around this problem by applying the following patch. If for some reason applying the patch fails, you can still do it by hand. Just locate the corresponding block in the PS file and remove the lines with a leading '-' character. By the way, this applies to any doc generated by Frame Maker. The corresponding block might be slightly different depending on which version of Frame Maker was used, but it is still easy to locate.
*** xpm.PS Wed Sep 11 15:47:43 1996 --- xpm-A4.PS Thu Nov 21 09:27:28 1996 *************** *** 647,668 **** 0 ne /edown exch def /yscale exch def /xscale exch def - FMLevel1 { - manualfeed {setmanualfeed} if - /FMdicttop countdictstack 1 add def - /FMoptop count def - setpapername - manualfeed {true} {papersize} ifelse - {manualpapersize} {false} ifelse - {desperatepapersize} {false} ifelse - { (Can't select requested paper size for Frame print job!) FMFAILURE } if - count -1 FMoptop {pop pop} for - countdictstack -1 FMdicttop {pop end} for - } - {{1 dict dup /PageSize [paperwidth paperheight]put setpagedevice}stopped - { (Can't select requested paper size for Frame print job!) FMFAILURE } if - {1 dict dup /ManualFeed manualfeed put setpagedevice } stopped pop } - ifelse FMPColor { currentcolorscreen --- 647,652 ----
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of GROUPE BULL shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from GROUPE BULL.