PGM to PNG Converter

Add a gray .pgm and get a PNG with every gray kept, for the apps and phones that won't open it.

FluffyShield Protected workspace
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. Each gray is read from the .pgm
  2. It goes into the PNG unchanged
  3. You save the PNG

What it does

Same grays, stored as gray

Switching PNG color to Grayscale (no alpha) moves no gray: a pixel that is 128 in the PGM is 128 in the PNG.

Limits A PGM with a pixel brighter than the top value its header allows gets an error, as does one that stops early.

Does the PNG store your gray picture as gray?

Not to start with: it keeps four numbers a pixel, and our gray photo grew. One setting stores one number, as the PGM does.

Where does the PNG's extra size come from?

A PGM keeps one number for every pixel: how bright it is. A PNG can store a gray picture the same way, but FluffyBench's PNG starts out stored like a color picture with a see-through channel. That's four numbers for every pixel: red, green and blue, which are always equal in a gray picture, and alpha, the see-through level, which here always says solid.

Our gray photo grew by over a quarter as a PNG

PGM 12.3 KB
PNG 15.8 KB

File size, KB

The same 128 by 96 gray photo in both files; the PNG was made with the converter's starting settings. How we measured

PNG packs those repeated numbers well, so the file is nowhere near four times the size, but it still ended up bigger than the PGM it came from.

Settings can store it as gray instead. Under More options, PNG color appears once PNG encoding is set to Advanced local encoder, and its Grayscale (no alpha) choice writes one number a pixel, as the PGM does.

Saving the PGM as a gray PNG

Steps 2 to 5 store the PNG as gray; without them you get the starting four numbers a pixel.

  1. Put the .pgm in with Choose images.

  2. Open Settings: behind the gear at the top of the tool on a phone, in the panel next to the tool on a computer.

  3. Open More options.

  4. Change PNG encoding to Advanced local encoder.

  5. Change PNG color to Grayscale (no alpha).

    The PNG settings with PNG encoding set to Advanced local encoder and PNG color set to Grayscale (no alpha), which is outlined.
    The PNG settings with PNG encoding set to Advanced local encoder and PNG color set to Grayscale (no alpha), which is outlined.
  6. On a phone, close Settings with the gear button. Then run Convert 1 to PNG.

  7. Download the PNG once its card says Done.

Only showing the picture to people?

The picture is for looking at, and nobody will measure its grays.

FluffyBench's PGM to JPG converter

Our photo's JPG took less than half the room of its PGM, with most grays nudged by a few steps.

Search FluffyBench