XPM to JPG Converter
You have an .xpm file from a Linux icon theme, an old application or a web page and your viewer shows nothing. XPM is a coloured picture written as C-style text. This converter reads the colour table and the rows of characters, rebuilds the picture and saves a normal file on your device.
Embed this tool on your websiteShow code
Free to use on any site. Paste the code where you want the tool to appear. It runs inside the page; visitors' files are processed in their own browser and are not uploaded.
WordPress and most site builders have a "Custom HTML" block where this code can be pasted. The embed keeps a small link back to CalcMaster.
How to convert XPM to JPG
- Add your XPM files by dropping them, clicking the drop zone or pasting.
- The output format is already set to JPG. Adjust quality or size if you need to.
- Press Convert and compare the original and new size for each file.
- Download each file or all of them as a ZIP.
When to convert, and when not to
- You need application icons from X11 software as ordinary picture files.
- A program, document or form does not accept the .xpm extension.
- You want to preview what a text-based pixmap really looks like.
- Do not convert to JPG if the icon has transparent areas you want to keep; use PNG instead.
What changes
- Each character in the text rows is looked up in the colour table and drawn as a pixel.
- Colours given as hex values and as colour names are both understood.
- The special colour None is treated as transparent and is filled with your background colour in JPG.
- Small icons stay small; use Resize with a percentage to enlarge them.
- Only the picture is kept; comments and names in the file are not carried over.
How an XPM describes a picture
XPM stands for X pixmap. Like XBM it is written as C source, but it holds colour. The file begins with a line giving the width, height, number of colours and how many characters stand for one pixel. Next comes a table linking each short code to a colour, and then the rows of codes that make up the image.
You can think of it as a picture drawn with letters. Each letter or short group of characters is a palette entry, and the rows of letters are the pixels. The converter walks through the rows, replaces each code with its colour and builds the image.
Colour names, hex values and transparency
Colours in an XPM can be written as hexadecimal values, such as the familiar six-digit form, or as names like red or light blue. The tool understands hex values and includes a built-in list of standard X11 colour names. If a file uses a name that is not in that list, you will see an error that points at the unknown colour.
The word None marks a pixel as transparent. JPG cannot store transparency, so those pixels are filled with the background colour you choose; white is the default. To keep the see-through areas, switch the output on the right to PNG or WebP.
What is supported and what is not
The tool reads the third version of the format, the one nearly every file uses, with one to four characters per pixel. Files written in the older second version are not supported and produce a clear message.
Because XPM keeps each colour exactly, a JPG copy adds a little compression noise around hard edges. For icons and flat artwork, PNG is the more faithful choice, and the converter lets you compare sizes before you download.
Linux icon folders often hold the same icon in several sizes. Convert whichever size you need, or add the whole folder and download the set as a ZIP. Each file is processed on its own, one after another, so a large batch does not freeze the page.
Privacy: your files stay on your device
- The tool decodes, resizes and encodes your pictures with your browser. The files are never sent to a server.
- To check it yourself: open the browser developer tools (F12), open the Network tab, convert a file, and look for any request that carries your image. You will see none.
Frequently asked questions
What is an XPM file?
A coloured picture stored as C-style text: a table of colours followed by rows of characters that name each pixel.
What happens to transparent areas?
The colour None is transparent. In a JPG it becomes your chosen background colour; PNG keeps it transparent.
Why do I see an error about a colour name?
The file uses a colour name that is not in the built-in list of X11 names. Replace it with a hex value in a text editor.
Are old XPM files supported?
The common third version is. The older second version gives an error.
Is JPG the best output for an icon?
Usually PNG is better, because it keeps flat colours and hard edges exactly.