Netpbm converter: PPM, PGM, PBM, PAM and PFM

Convert PPM images to PNG; transparency is preserved.

FluffyShield Protected workspace
From
To

Choosing a format opens another page, set to that conversion. Images you've added here come along. Finished files don't, so download them first.

FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

PNG options here: browser or advanced encoder; RGBA, RGB, grayscale or indexed color; 8- or 16-bit; Fast, Balanced or Maximum compression; interlacing. Which PNG settings are worth changing?

How it works
  1. Choose images
  2. Check the To format and Size
  3. Convert
  4. Download your copies

What it does

Five formats, two spellings

PPM, PGM, PBM, PAM and PFM open as ordinary pictures, plain-text PBM, PGM and PPM included.

PAM keeps transparency

A see-through Earth cutout came out of PAM exactly as it went in.

Earth cutout through PAM: 0 of 9,216 pixels changed

One file or many

Convert several files at once, then save them together in a ZIP.

Limits Only PAM keeps transparency; the other four flatten it onto white.

What turns a PPM, PGM or PBM file into an ordinary picture?

FluffyBench's Netpbm converter does, for all five Netpbm formats, right on your own device. A color PPM comes through with every pixel unchanged, and you can save pictures back out as Netpbm too.

Why are there five Netpbm formats?

Netpbm files are about the simplest pictures there are: a short label on top, then a list of pixel values, a bit like a spreadsheet. That makes them easy for a programmer to read and write, which is why Unix tools, school projects and research code still use them. The five formats differ in what each pixel holds. PBM holds black or white, PGM holds a shade of gray, PPM holds color, PAM holds whatever channels its label lists (including transparency), and PFM holds light levels that can go brighter than white.

Here's one photo saved in each format. The files run from 1.5 KB to 147.5 KB, because each format stores a different amount for every pixel.

The PFM file is 95 times the size of the PBM

PBM 1.5 KB
PGM 12.3 KB
PPM 36.9 KB
PAM 36.9 KB
PFM 147.5 KB

File size, KB

Each bar is the size of one photo saved in that format; sizes are rounded to 0.1 KB. How we measured

PBM, PGM and PPM also come in two spellings: plain text you could read in Notepad, and a compact binary version. FluffyBench's Netpbm converter opens both. What you get back depends on which of the five you have.

Which Netpbm formats keep the whole picture?

PPM and PAM do. Our color photo came through both untouched: none of its pixels changed as a PPM, and none as a PAM.

PGM and PBM never stored the whole picture, and a converted copy can only keep what the file had. A PGM holds only brightness, so its PNG is a gray picture. A PBM keeps one black-or-white bit per pixel, so a photo turns into dots.

The same photo as FluffyBench opens it from a PBM file, a PGM file and a PPM file.

The Lassen Peak photo as black and white dots: the peak and the beach are white and the sky and the lake are black.

PBM

The Lassen Peak photo in shades of gray.

PGM

The Lassen Peak photo in full color: blue sky, a pale peak, dark trees, a blue lake and a pale beach.

PPM

All three pictures are drawn from the decoded sample files. In the PBM every pixel is black or white, so the peak and the beach show as white patches against black. In the PGM brightness survives and color doesn't: 12,249 pixels differ from the color photo. The PPM keeps the blue sky, dark trees and blue lake as the photo had them. · Photo: NPS Photo, Public domain, U.S. federal work; Public Domain Mark 1.0, via Wikimedia Commons / National Park Service.

See-through areas are the other thing to watch when you save a picture as Netpbm. Only PAM can store them. PPM, PGM, PBM and PFM put transparent areas on white, so keep your original if those edges matter.

Our Earth cutout as a PAM file, and as the PPM FluffyBench writes from it.

The Earth with a checkerboard showing around the planet, because the PAM file has see-through corners.

PAM

The same Earth on a plain white background.

PPM

The PAM picture is drawn from the sample file and the PPM from the file FluffyBench wrote, both over the same checkerboard. PAM stores a transparency value for each pixel, so its corners stay see-through: 0 of its 9,216 pixels changed. The corners that were see-through are plain white in the PPM, and writing the cutout as a PPM changed 2,383 pixels. · Photo: NASA, Public domain, NASA-created image, via Wikimedia Commons.

That covers four of the five formats. PFM is the odd one out, because its numbers can go brighter than white.

What happens to the extra-bright light in a PFM?

It gets squeezed to fit. A PFM stores raw light levels, where 1.0 is white and larger numbers are brighter still, but a normal picture stops at white. Picture a long list of brightness levels pressed onto a shorter ruler: everything still fits, with the brightest values packed closest together. That's the fixed tone curve FluffyBench applies.

You get a 16-bit PNG with a Display P3 color profile. Because of the curve, every pixel of our photo came out different from the ordinary picture the PFM was made from, by at most 68 on a 0 to 255 scale. The range above white doesn't survive in the PNG, so keep your PFM if you need it.

Doing it in FluffyBench's Netpbm converter

Here's the job from choosing a Netpbm file to saving its PNG copy.

  1. Choose one Netpbm file or several with Choose images. The file is read on your device.

  2. On a phone, open Settings with the gear button marked PNG.

  3. Under Size, Original keeps the picture's width and height.

    The Size control set to Original, outlined.
    The Size control set to Original, outlined.
  4. Close Settings with the gear button, then press Convert to make the PNG copy.

  5. The tile reports the PNG's dimensions and size. Download saves it.

    The finished PNG with its size and the Download button outlined.
    The finished PNG with its size and the Download button outlined.

To save a picture as Netpbm instead, change the To menu to PPM, PGM, PBM, PAM or PFM, and Settings shows what that format needs. Netpbm storage picks plain text or binary for PPM and PGM. PBM has a Black & white setting for a plain Threshold or Floyd-Steinberg dots, and PFM has PFM channels and Byte order. Plain text is easy to read, but it costs space.

Our photo took 128.4 KB as a plain-text PPM and 36.9 KB as a binary one.

The plain-text PPM was 3.5 times the size of the binary one

Plain text 128.4 KB
Binary 36.9 KB

File size, KB

Plain text writes every value out in digits, so the same pixels take more room. Sizes are rounded to 0.1 KB.

Damaged files, and PAM files with CMYK channels. A file cut short fails with “This image couldn't be processed.” and the Details line says what's missing, such as “The Netpbm raster payload is truncated.” A CMYK PAM gets “This PAM TUPLTYPE is not handled by this converter.” Either way you get a reason, not a guessed picture.

Netpbm files also run large, so they're rarely the best way to share a picture. If you need a smaller copy or one that more apps can open, these FluffyBench tools help.

Need a photo small enough to send?

FluffyBench's JPG converter

JPG files are much smaller than Netpbm files, but JPG can't keep transparency.

Need to fit an upload limit?

FluffyBench's Image Space Saver

It resizes and compresses a picture toward a file size you choose.

Need a compressed PNG from a Netpbm file?

Need a TIFF for print or archive?

Need an OpenEXR file with a wider range?

Search FluffyBench