Resize PPM Images

A PPM file holds plain, uncompressed colour pixels, which is why scripts, course exercises and small imaging tools like it. Yours may simply be too large, or the wrong pixel size, for whatever reads it next. This page changes only the width and height. The file you download is still a PPM, written on your own device, and it is never uploaded.

Drop images here, click to choose, or paste with Ctrl+V
PPM files · the file type stays the same · many files at once · nothing is uploaded

How to resize PPM images

  1. Add your PPM files by dropping them, clicking the drop zone or pasting.
  2. Choose the new size: a percentage, a maximum width and height, or an exact size. The quick sizes fill in common values.
  3. Press Resize and compare the old and new size of each file. The file type stays the same.
  4. Download each file or all of them as a ZIP.

When to resize, and when not to

  • A program or script expects a particular width and height, and your PPM does not match.
  • The file is huge because every pixel is stored in full, and you only need a smaller working copy.
  • You want a quick test image at a fraction of the size to try an algorithm before running it on the original.
  • Do not enlarge a PPM to gain detail: new pixels are guessed from the old ones, so the picture only gets bigger, not sharper.

What changes

  • The pixel dimensions change; the file type does not. Your download ends in .ppm and is named with the new size, like name-640x480.ppm.
  • The picture is redrawn at the new size with smoothing, so edges are blended rather than copied pixel for pixel.
  • The result is written as a binary P6 file with three 8-bit colour values per pixel, even if your original was a text-style PPM or used more bits per channel.
  • PPM has no transparency, so any empty space created by Fit inside is filled with the background colour you pick.

How a PPM's size is decided

Because a PPM stores raw colour values with no compression, its file size follows directly from its dimensions: roughly the width times the height times three bytes, plus a very small header. That makes resizing unusually predictable. Halve the width and the height and the file becomes about a quarter of the size, because there are a quarter as many pixels.

This is also why the optional file size target behaves differently here than for a JPG. A PPM has no quality setting to lower, so the only way to reach a target is to reduce the pixels. If you ask for a size that the picture cannot meet at its current dimensions, the tool shrinks it until it fits and tells you what size it ended up at.

Percent, max size or exact size

Percent scales both sides by the same amount, anywhere from a small thumbnail to a doubled copy. Max size fits the picture inside a width and height box you choose and only ever shrinks it, so a picture already smaller than the box is left alone. Exact size gives you the precise width and height, which is what many scripts want.

With Exact size you also choose how the picture meets the new shape. Fit inside keeps the whole picture and pads the rest with the background colour. Fill and crop covers the whole area and trims the overflow from the centre. Stretch forces the picture to the new size and can change its proportions. If the new size has the same shape as the old one, all three give the same result.

Only .ppm files here

This page accepts PPM files. Other members of the same family, such as PGM, PBM, PNM and PAM, are read by the Image Converter, which can save them in other formats. The resizer is deliberately narrow: it never changes the type of what you give it, so it only takes files it can hand back in the same format.

Privacy: your files stay on your device

  • The tool decodes, resizes and encodes your pictures with your browser. The files are never sent to a server.

Frequently asked questions

Will my PPM still be a PPM afterwards?

Yes. The resizer never changes the file type. You get a PPM back, named with the new width and height.

Why is the resized file not much smaller?

PPM size depends only on the number of pixels. A modest reduction in width and height gives a modest saving, so try a smaller percentage or a lower max size.

Does it keep transparency?

PPM cannot store transparency. If your picture had see-through areas, or Fit inside creates empty space, those areas are filled with the background colour.

My original used 16 bits per colour. What happens?

The tool works at 8 bits per colour, so the resized file is 8-bit. If you need the extra precision, resize in a program that keeps it.

Can I resize PGM or PBM files here?

Not on this page. It takes .ppm files only. Use the Image Converter for other portable pixmap and bitmap types.

Related tools