Convert XPM to PNG

Turn XPM images into PNG. Same size and colors, with transparent pixels kept.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop XPM files on the dialor turn it to pick what to do

An XPM image as a regular PNG.The picture keeps its size and colors, and transparent pixels stay transparent.

  1. What you get

    A PNG with the same width and height as the XPM. The colors stay the same, and pixels that are transparent in the XPM are transparent in the PNG.

    XPM stores an image as C source code. The PNG is a regular image file that holds a lossless raster picture with an alpha channel. The conversion gives you one file.

  2. Options

    Set Max width or Max height to shrink a large image. The shape stays the same, and an image that is already smaller than the limit is not enlarged. Both accept values from 1 to 20000.

    Turn on Grayscale to turn the colors into shades of gray. This often makes the file smaller. Set Rotate to turn the result clockwise by 90, 180 or 270 degrees.

  3. When it stops

    If the XPM cannot be parsed, the conversion stops with input_corrupted. The file is damaged or is not a valid XPM.

    To go the other way, use PNG to XPM.

XPM and PNG.What each format is, and the options this conversion takes.

  1. 01 · grayscale

    Grayscale

    Turns colors into shades of gray, which often makes the file smaller.

  2. 02 · max_height

    Max height (px)

    Shrinks anything taller than this, keeping its shape. Anything shorter stays as it is, so nothing is ever enlarged.

    1 to 20000
  3. 03 · max_width

    Max width (px)

    Shrinks anything wider than this, keeping its shape. Anything narrower stays as it is, so nothing is ever enlarged.

    1 to 20000
  4. 04 · rotate

    Rotate

    Turns the result clockwise by a quarter, a half or three quarters.

    90 · 180 · 270

The formats

From · XPM

X PixMap

X PixMap, images as C source.

Extensions
.xpm
MIME type
image/x-xpixmap
Kind
Images
To · PNG

PNG

Lossless raster images with an alpha channel. Screenshots, icons and graphics with sharp edges.

Extensions
.png
MIME type
image/png
Kind
Images

In your code.The same XPM to PNG conversion through the API, for your app or your agent.

terminal
$ cv convert photo.xpm photo.png
$ cv convert photo.xpm photo.png

Questions.What people ask about XPM to PNG.

01OF 04

Yes. Transparent pixels in the XPM stay transparent in the PNG.

No. The PNG has the same width and height unless you set Max width or Max height. Those options only shrink larger images.

Yes. Set Rotate to 90, 180 or 270 to turn the result clockwise by that many degrees.

The file could not be parsed. The conversion stops with this code when the XPM is not readable.

More conversions.Other ways in and out of XPM and PNG.