Skip to content

Convert JPG to XPM

Convert JPG images to XPM with GIMP, using palette reduction and dithering for X11 icons.

Convert JPG files online

We don’t have a dedicated online converter for JPG to XPM yet, but you can convert JPG files online to these and more formats:

Want to convert JPG to XPM?

Let us know. We pick the conversions to add next by how many people ask for them.

How to convert jpg to xpm file

An X11 application, icon theme, or source tree may require an XPM pixmap rather than a JPG image. Converting makes the image usable there, but JPG’s full-color pixels must be reduced to an XPM palette.

What JPG is

JPG, usually stored with the .jpg or .jpeg extension, is a lossy raster format used mainly for photographs and web images. Cameras, phones, image editors, and browsers commonly handle it; JPG does not support transparency.

What XPM is

XPM (X PixMap) is a text-based raster format used mainly for icons and pixmaps in X Window System software. It stores a color table and pixel rows as character strings, which can be embedded in C source code or edited as text. Its palette and transparent-color support suit icons, but not the full color range of photographs.

How to convert JPG to XPM

GIMP is a suitable desktop option:

  1. Open the JPG with File → Open.
  2. Choose Image → Mode → Indexed, set a palette limit (up to 256 colors is a practical choice for an icon), and select dithering if gradients show visible banding.
  3. Choose File → Export As, enter a filename ending in .xpm, and select Export. Confirm the export options if GIMP displays them.
  4. Open the saved file in the application that needs it, or inspect it in an editor that supports XPM.

With an ImageMagick build that includes XPM support, use magick input.jpg -colors 256 output.xpm. Change the filenames or color limit as needed.

For a browser-based option, Convertio can convert JPG to XPM: upload the image, choose XPM as the output format, convert, and download the result. Avoid uploading images that should remain private, and check that the service offers the required XPM output before conversion.

Quality and compatibility

Palette reduction discards color detail; dithering can soften banding but may add a speckled appearance. JPG compression artifacts can also affect the resulting palette. Because JPG has no alpha channel, conversion does not automatically create transparent areas; make them transparent separately in an editor if needed. XPM text can be larger than a compressed JPG, especially for photographs. Check that the receiving software accepts the XPM variant and palette produced by your tool.

Information about file extensions and file types is provided by File-Extensions.org

Additional formats for
jpg file conversion

Reverse conversion

Convert to xpm from
other formats

Share on social media:

Already downloaded

This file has already been downloaded. For your privacy it was deleted from our server right after the download, so it cannot be downloaded again. To get it once more, convert the file again.