PNG vs PPM: technical differences
To convert PNG to PPM, drop your PNG file into the converter above and download the PPM: the plain, uncompressed Netpbm format that image-processing scripts read. It is free, needs no sign-up, and runs in your browser, so the file is never uploaded.
PPM (from the Netpbm family) has almost no structure: a short text header such as P6 1920 1080 255 and then raw red, green and blue bytes for each pixel, top row first. There is no compression, no alpha and no metadata, so a 1920×1080 image becomes exactly 6,220,800 bytes of pixel data plus about 17 header bytes.
That simplicity is the point. Reading a P6 file needs a few lines of code and no library, which is why it appears in programming courses, ray-tracer tutorials and image-processing experiments. Because PPM has no transparency, Pixohub blends any transparent PNG pixels onto white, and writes 8 bits per channel (maximum value 255).
| PNG (Portable Network Graphics) | PPM (Portable Pixmap (Netpbm)) | |
|---|---|---|
| Compression | Lossless (DEFLATE with per-row prediction filters) | None (raw binary P6 or ASCII P3) |
| Colour depth | 1–16 bits per channel; truecolor, greyscale or 256-colour palette | 8 or 16 bits per channel, RGB only |
| Transparency | Full 8/16-bit alpha channel | None |
| Animation | Only via the APNG extension | None |
| Metadata | Text chunks, ICC profile, gamma; EXIF via the newer eXIf chunk | Comment lines in the header only |
| Typical file size | Large for photos (often 2–3× a JPG); tiny for flat graphics | Very large — exactly width × height × 3 bytes plus a header |
| Support | Universal — every browser, OS and editor | Image-processing libraries, Netpbm, GIMP; not browsers |
When to convert PNG to PPM
Programming assignments and image-processing exercises
Computer-science courses often require students to read and write PPM so they can focus on the algorithm (blur, edge detection, histogram equalisation) rather than on PNG decompression. Converting your own PNG test image gives you an input that a hand-written loader will parse.
Texturing a hobby ray tracer or renderer
Many introductory renderers write their output as PPM and some read PPM textures too. If you want to map a PNG image onto a sphere in your own renderer, PPM is the least effort to load.
Feeding command-line pipelines
Netpbm tools, ImageMagick and FFmpeg all read PPM, and it is a common lowest-common-denominator format for piping frames between programs. Converting here is handy when you have a single PNG and no command-line tools installed on the machine in front of you.
What converting PNG to PPM keeps and loses
What you keep
- Every opaque pixel exactly — no compression is applied (a PNG with a colour profile such as Display P3 is converted to sRGB first).
- Pixel dimensions.
What you lose
- Transparency — flattened onto white.
- All metadata, colour profiles and text chunks; PPM only allows header comments, and Pixohub writes none.
- 16-bit precision (the output's maximum value is 255).
- Compact size — the PPM is uncompressed and usually much larger than the PNG.
Our test: PNG to PPM on two real files
PPM is width × height × 3 bytes plus a text header: 5,760,017 bytes for the photo (a 17-byte header) and 1,440,015 for the graphic (15 bytes). That is 37 and 39 bytes smaller than the matching BMPs, which use a 54-byte header and, at these widths, need no row padding.
The graphic's transparency was flattened onto white and matched that reference exactly. The photo measured 33.56 dB PSNR, SSIM 0.9996, because the browser converted its Display P3 colours to sRGB; a PPM reader therefore gets sRGB values, not the raw numbers stored in the PNG. Both files took under a second.
Method: this converter in Chromium (Playwright 1.64.1) on an Apple M2 Mac, default 85% quality for lossy output. The photo is an iPhone 14 Pro Max shot scaled to 1600 × 1200, metadata intact; the graphic has a transparent background, soft shadow, gradients and text. SSIM and PSNR compare each result with the decoded original on white (how we test).
| Test file | PNG in | PPM out | Pixels vs original | Transparency | Camera EXIF | Time |
|---|---|---|---|---|---|---|
| Photo, 1600 × 1200 | 2.1 MB | 5.8 MB (2.8× larger) | SSIM 1.000 · 33.6 dB | None in source | Removed | 1.0 s |
| Graphic, 800 × 600, transparent | 225 KB | 1.4 MB (6.4× larger) | Identical pixels | Flattened onto white | None in source | 0.9 s |
Last updated
Apps and sites that work with PNG and PPM
Libraries for coursework
stb_image reads binary PPM and PGM only, not the ASCII variants, which suits Pixohub's P6 output. Pillow, OpenCV's imread and MATLAB's imread all read PPM too, so a single converted test image works whether the assignment is in C, Python or MATLAB.
Netpbm and ImageMagick
On a machine with Netpbm installed, pngtopam does this conversion on the command line and pnmtopng reverses it; ImageMagick's magick in.png out.ppm does the same. Converting here is the equivalent when you are on a lab or library computer without those tools.
Viewing the output
GIMP opens PPM and can export either raw or ASCII PNM, which is the quickest route if your assignment wants P3. IrfanView on Windows also opens PPM; Windows Photos does not, so a blank preview there says nothing about whether the file is valid.
Common PNG to PPM problems and fixes
Your pixel values don't match what Pillow reads from the PNG
If the PNG has a colour profile (iPhone and Mac images often carry Display P3), the browser converts it to sRGB before writing the PPM. Pillow reads the PNG's stored numbers without colour management, so the two can differ; in our test by up to 74 levels in one channel. Use the PPM as your ground truth, or strip the profile before converting both.
The transparent test image has a white background
PPM has no alpha channel, so transparency is blended onto white. If your exercise needs alpha, Netpbm's PAM format (P7) can hold it, but most course readers expect P6. For edge-detection or blur tests, choose a source image without transparency so the white fill does not create artificial edges. The fill is exactly 255 in all three channels.
The file is too large to submit
A 1600 × 1200 test image becomes 5.8 MB as PPM, which can exceed an assignment upload limit or bloat a Git repository. Shrink the PNG with the image resizer first; 512 × 512 gives a PPM of about 786 KB, still large enough to show what a filter does.
Tips for better PNG to PPM results
- Pixohub writes binary P6. If your assignment requires the ASCII variant (P3), you will need to convert it with a small script or Netpbm's tools.
- Keep test images small (for example 256×256) while debugging your code — the files and your loops both stay fast.
How this converter works
Pixohub decodes your PNG and encodes the PPM entirely inside your browser. Nothing is uploaded, so the conversion is private by design and as fast as your device.
Need more? Shrink the result with the image compressor, change its dimensions with the image resizer, or convert a whole folder at once with bulk format convert.