PPM vs AVIF: technical differences
To convert PPM to AVIF, drop your PPM file into the converter above and download the AVIF: a modern format, usually smaller than JPG and WebP at the same quality, that supports transparency. It is free, needs no sign-up, and runs in your browser, so the file is never uploaded.
AVIF is the most compact target for PPM output. Its AV1 compression handles smooth gradients and soft lighting, typical of ray-traced and procedural images, especially well, often producing files smaller than WebP at the same quality.
Pixohub decodes the PPM in JavaScript and encodes AVIF with Safari's built-in encoder or, in Chrome, Edge and Firefox, a bundled libavif compiled to WebAssembly, which is why it takes a few seconds. AVIF's 10/12-bit modes aren't used, because the canvas works in 8-bit, so a high-maxval P3 file is reduced to 8 bits per channel.
There's no alpha in PPM, so the AVIF is opaque. AV1's characteristic artifact at low quality is smoothing. Fine path-tracing noise may simply disappear, which can look cleaner but no longer matches your program's exact output.
| PPM (Portable Pixmap (Netpbm)) | AVIF (AV1 Image File Format) | |
|---|---|---|
| Compression | None (raw binary P6 or ASCII P3) | Lossy or lossless (AV1 intra-frame in a HEIF container) |
| Colour depth | 8 or 16 bits per channel, RGB only | 8, 10 or 12 bits per channel; HDR and wide gamut capable |
| Transparency | None | Full alpha channel |
| Animation | None | Yes (image sequences) |
| Metadata | Comment lines in the header only | EXIF, XMP, ICC / CICP colour signalling |
| Typical file size | Very large — exactly width × height × 3 bytes plus a header | Usually the smallest — often half a JPG at similar quality |
| Support | Image-processing libraries, Netpbm, GIMP; not browsers | Chrome, Edge, Firefox and Safari 16+; patchy in older desktop software |
When to convert PPM to AVIF
Publishing renders at the smallest size
For a project page that shows many high-resolution renders, AVIF keeps total page weight down more than any other web format supported by current Chrome, Edge, Firefox and Safari 16+.
Comparing codecs as a learning exercise
Students studying compression can take one PPM and convert it to JPG, WebP and AVIF at the same quality, then compare file size and artifacts. AVIF's blur-not-blocks behaviour is easy to see.
Honest note
AVIF isn't for analysis or grading. Pixel values change, and not every tool opens it. Keep the PPM, or a PNG copy, as your reference.
What converting PPM to AVIF keeps and loses
What you keep
- Resolution and orientation.
- Good perceived quality at 60–80% on smooth renders.
What you lose
- Exact pixel values and fine noise (lossy smoothing).
- Precision above 8 bits per channel.
- PPM header comments.
- Instant export: encoding takes seconds, not the near-instant result of PNG or JPG.
Our test: PPM to AVIF on two real files
AVIF produced the highest measured quality of the lossy targets from the photo PPM, 43.61 dB PSNR at 303 KB, while WebP reached 39.87 dB at 225 KB at the same 85% setting. On the opaque graphic AVIF was also the smallest file: 14 KB at 45.32 dB, against 15 KB for WebP and 32 KB for JPG.
The cost is encoding time: 7.0 s for the photo, about four times WebP's 1.7 s, because Chromium lacks an AVIF encoder and Pixohub runs libavif in WebAssembly.
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 | PPM in | AVIF out | Pixels vs original | Transparency | Camera EXIF | Time |
|---|---|---|---|---|---|---|
| Photo, 1600 × 1200 | 5.8 MB | 303 KB (−95%) | SSIM 0.990 · 43.6 dB | None in source | None in source | 7.0 s |
| Graphic, 800 × 600, transparent | 1.4 MB | 14 KB (−99%) | SSIM 0.998 · 45.3 dB | None in source | None in source | 2.4 s |
Last updated
Apps and sites that work with PPM and AVIF
Browsers
Chrome, Edge, Firefox and Safari 16 or later display AVIF, so a project page can serve renders as AVIF with a JPG or WebP fallback for older browsers. Older browsers ignore the AVIF source and load the fallback, so nothing breaks.
Command-line encoding
ImageMagick builds with libheif write AVIF straight from a PPM (magick render.ppm -quality 70 render.avif), which suits large frame sets better than encoding one image at a time in a browser. Builds without AVIF support fail with an error; magick -list format shows whether yours has it.
Papers and reports
pdfLaTeX, Word and most journal systems can't embed AVIF, so it isn't a figure format. Use PPM to PNG for papers and keep AVIF for web pages. Jupyter notebooks and most image-processing libraries handle PNG more reliably than AVIF as well.
Common PPM to AVIF problems and fixes
The tab seems frozen on a large render
Encoding happens in WebAssembly on your device. Our 1600 × 1200 photo took 7.0 s; a 3840 × 2160 render has 4.3 times as many pixels and takes considerably longer. Wait for it to finish, or resize first with the image resizer. On a phone, keep the tab in front, since browsers may pause background tabs and slow the encoder down.
Your analysis code can't open the AVIF
OpenCV and older Pillow versions often have no AVIF support, so a script that loads the result fails. AVIF is for display only: keep the PPM or a PNG for anything you measure or compare. pillow-avif-plugin adds AVIF reading to Pillow if you really need it in a script, but PNG is simpler.
Bright areas are clipped
Values larger than the header's maxval are clipped to white. Renderers that write unclamped HDR values into a P3 file with maxval 255 lose their highlights. Tone-map or clamp in your program before writing the PPM. The same clipping happens for every output format; AVIF's own HDR support isn't used because the canvas is 8-bit.
Tips for better PPM to AVIF results
- Noisy low-sample renders compress poorly in any format. Denoising or rendering more samples per pixel shrinks the AVIF more than lowering quality does.
- Converting dozens of frames? PPM to WebP encodes several times faster.
How this converter works
Pixohub decodes your PPM and encodes the AVIF entirely inside your browser, using a bundled PPM decoder because browsers cannot open PPM natively. 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.