HEIC vs PPM: technical differences
To convert HEIC to PPM, drop your HEIC 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 is about as simple as an image file gets. A short text header (“P6”, width, height, 255) is followed by raw RGB bytes, 3 per pixel, top row first. A 4032 × 3024 iPhone photo becomes 36,578,304 bytes of pixels plus about 20 bytes of header. Compare that with 1–3 MB for the HEIC, which needs an HEVC decoder to read at all.
That trade is the point. Reading a HEIC from C, Python or Rust means linking libheif and an HEVC decoder. Reading a P6 PPM takes a few lines of code. Pixohub decodes the HEIC in the browser with heic-to, a libheif build, with no intermediate JPEG, then writes binary P6 at 8 bits per channel.
PPM has no alpha, no colour profile and no metadata beyond comment lines, which Pixohub doesn't write. The values are the photo's own 8-bit RGB as stored (for an iPhone, Display P3 numbers, not converted to sRGB), without HDR or EXIF orientation. The pixels are already rotated upright, so row 0 is the top of the photo as you saw it on the phone.
| HEIC (High Efficiency Image Container) | PPM (Portable Pixmap (Netpbm)) | |
|---|---|---|
| Compression | Lossy HEVC (H.265) intra-frame in a HEIF container | None (raw binary P6 or ASCII P3) |
| Colour depth | 8 or 10 bits per channel; Display P3 on iPhone | 8 or 16 bits per channel, RGB only |
| Transparency | Not used in iPhone photos | None |
| Animation | Live Photos and bursts are stored as sequences | None |
| Metadata | EXIF, XMP, depth maps, HDR gain maps | Comment lines in the header only |
| Typical file size | About half a JPG of the same photo | Very large — exactly width × height × 3 bytes plus a header |
| Support | Apple devices natively; Windows needs an extension; most browsers cannot display it | Image-processing libraries, Netpbm, GIMP; not browsers |
When to convert HEIC to PPM
Feeding a phone photo to your own image code
Computer-vision and graphics courses often have students write convolution filters, edge detectors or histogram tools that read PPM. Converting a HEIC snapshot gives you a real-world test image without installing libheif.
Netpbm and Unix pipelines
Tools such as pnmscale, pnmcut and pnmtojpeg, plus many scripts built on them, work on PPM streams. A converted iPhone photo drops straight into those pipelines.
Embedded and test fixtures
Firmware and test suites sometimes embed small PPMs because they need no decoder library. Resize the photo to the size you need first. The 36 MB full-size file is rarely what you want in a repo.
What converting HEIC to PPM keeps and loses
What you keep
- Full resolution, with pixels in upright orientation.
- Exact 8-bit RGB values of the decoded image, uncompressed.
- A trivially parseable layout: header, then width × height × 3 bytes.
What you lose
- EXIF date, GPS location and camera data.
- HDR range, 10-bit depth and Display P3 colour.
- Any compression: the file is roughly 12–30× the HEIC.
- Depth maps and auxiliary images.
Our test: HEIC to PPM on two real files
The P6 file was 5,760,017 bytes for the 1600 × 1200 photo: 3 bytes per pixel plus a 17-byte text header, 7.6 times the 755 KB HEIC. The graphic produced 1.4 MB with its transparency flattened onto white, because PPM has no alpha.
Measured against a libheif reference decode, every channel was within 3 levels (64.15 dB). If your own code decodes the same HEIC with libheif, expect near-identical values, not byte-identical ones. The conversion took 2.6 s, most of it HEIC decoding rather than writing the PPM.
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 | HEIC in | PPM out | Pixels vs original | Transparency | Camera EXIF | Time |
|---|---|---|---|---|---|---|
| Photo, 1600 × 1200 | 755 KB | 5.8 MB (7.6× larger) | SSIM 1.000 · 64.2 dB | None in source | Removed | 2.6 s |
| Graphic, 800 × 600, transparent | 100 KB | 1.4 MB (14× larger) | SSIM 1.000 · 64.7 dB | Flattened onto white | None in source | 2.0 s |
Last updated
Apps and sites that work with HEIC and PPM
Reading the PPM in your code
Python's Pillow and imageio, OpenCV's imread, MATLAB's imread and the single-header stb_image library all read binary P6. Reading the HEIC itself would need pillow-heif or libheif bindings, so the PPM spares a one-off test or assignment that dependency. In Python, numpy.asarray(Image.open('photo.ppm')) gives a height × width × 3 array ready for processing.
Viewing the result
Browsers and Windows Photos can't display PPM. GIMP, Krita, IrfanView, XnView and the GNOME image viewer can, so use one of those to check that the photo arrived upright and complete before you feed it to your program. Opening it there also confirms the header and pixel count are what your parser expects.
Why the browser route is often shortest
macOS's built-in sips converts HEIC to TIFF, BMP or TGA but has no Netpbm output, and Windows has no HEIC-aware command-line tool by default. Unless ImageMagick with libheif is already installed, converting in the browser is the quickest way from an iPhone photo to PPM.
Common HEIC to PPM problems and fixes
Your parser reads shifted colours
Pixohub writes exactly one newline after the maxval and no comment lines, so pixel data starts at byte 17 for a 1600 × 1200 image. A parser that skips all whitespace after 255 swallows the first pixel byte whenever its value is 9, 10, 13 or 32, shifting every colour after it. Read the header token by token and then consume exactly one whitespace byte.
Transparent areas came out white
A HEIC with an alpha channel loses it, because PPM stores RGB only and Pixohub blends onto white. If your algorithm needs a black background or the mask itself, convert with HEIC to PNG as well and composite or read the alpha in your own code. Pixohub blends with straight alpha, so a pixel at 50% opacity ends up halfway between its colour and white.
Values differ from another decoder
Comparing against pillow-heif or another HEIC decoder, expect individual values to differ by up to 3 levels, as in our test, because chroma upsampling and rounding vary between decoders. Note too that the numbers are the photo's Display P3 values, not converted to sRGB. Allow a small tolerance in tests, or generate every reference from the same PPM.
Tips for better HEIC to PPM results
- Python check: open('photo.ppm','rb').read(20) should start with b'P6\n4032 3024\n255\n' for a standard 12 MP iPhone photo. Pixel data begins right after that final newline.
- If you need greyscale (PGM) or ASCII (P3), convert this PPM with Netpbm (ppmtopgm, or pnmtoplainpnm for ASCII).
How this converter works
Pixohub decodes your HEIC and encodes the PPM entirely inside your browser, using a bundled HEIC decoder because browsers cannot open HEIC 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.