Convert PNM to PNG

Turn PNM images into PNG. Same pixels without loss.

Converted in an isolated sandbox on our serversDeleted after 24 hours

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

PNM images as PNG files.The pixels stay the same, and gray pictures stay gray.

  1. What you get

    One PNG file for each PNM image. PNM covers PBM, PGM and PPM files, and all three are read. The pixels are copied without loss.

    Black-and-white and gray pictures stay gray. They are not turned into color.

  2. Options

    Set Grayscale to turn colors into shades of gray. This often makes the file smaller.

    Set Max width or Max height to shrink a picture that is larger than the value you give. The shape is kept, and a picture that is already smaller stays as it is, so nothing is enlarged. Both accept values from 1 to 20000.

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

  3. When it stops

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

    To go the other way, use PNG to PNM.

PNM 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 · PNM

Portable Anymap

Portable anymap images, the simplest raster format: PBM, PGM and PPM.

Extensions
.pnm .ppm .pgm .pbm
MIME type
image/x-portable-anymap
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 PNM to PNG conversion through the API, for your app or your agent.

terminal
$ cv convert photo.pnm photo.png
$ cv convert photo.pnm photo.png

Questions.What people ask about PNM to PNG.

01OF 04

No. The pixels are the same as in the PNM file. Only the options you turn on change the picture.

PBM, PGM and PPM files. They all count as PNM.

No. Black-and-white and gray pictures stay gray in the PNG.

Yes. Set Max width or Max height, and a larger picture shrinks with its shape kept. Smaller pictures are not enlarged.

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