What Happens When You Convert a 48.8-Megapixel HEIC in Your Browser?
HEIC files lie about how much work they are.
A modern phone can produce a photo with almost 49 million pixels while the file itself weighs only a few megabytes. That is excellent for storage, but browser-based image processing has to unpack that compressed file into something much larger before it can manipulate the pixels.
We tested a real 48.77-megapixel HEIC using a WebAssembly HEIC decoder, then converted the decoded image to JPEG, WebP and PNG. We measured decoding time, raw pixel memory, encoding time, output size and the resulting end-to-end pipeline time.
Key takeaways
- A 6.81 MB HEIC expanded to approximately 186.05 MB of raw RGBA pixel data.
- The 48.77 MP image took an average of 2,088 ms to decode into usable pixels.
- JPEG encoding added only 818.5 ms, producing an 11.24 MB file.
- WebP produced the smallest output at 9.74 MB, but took 11.75 seconds to encode.
- PNG encoded in 1.40 seconds but produced a massive 71.93 MB file.
- The benchmark shows why compressed file size alone is a poor indicator of browser processing cost.
The test image
Our test file, IMG_1089.HEIC, was a high-resolution iPhone-style photograph measuring 8064 × 6048 pixels.
| Property | Result |
|---|---|
| File | IMG_1089.HEIC |
| File size | 6.81 MB |
| Width | 8,064 px |
| Height | 6,048 px |
| Total pixels | 48,771,072 |
| Megapixels | 48.77 MP |
| Raw RGBA requirement | 186.05 MB |
The compressed file is small. The image isn't.
HEIC compression means the original file can remain extremely small compared with the amount of information represented by its pixels. Once decoded into RGBA, every pixel requires four bytes.
48,771,072 pixels × 4 bytes = 195,084,288 bytes ≈ 186.05 MB
That is a calculated 27.32× expansion from the compressed HEIC file to the raw RGBA pixel buffer.
This is the raw RGBA buffer, not total browser memory usage. A real browser process can require additional memory for the WebAssembly heap, decoder, canvas, intermediate buffers and other allocations.
Decoding took about two seconds
We ran the pixel-decode operation ten times to measure repeatability. The results were remarkably close together on the test system.
| Measurement | Time |
|---|---|
| Cold decoder initialization | 20.00 ms |
| First pixel decode | 2,073.90 ms |
| Mean | 2,088.47 ms |
| Median | 2,080.50 ms |
| Fastest | 2,061.30 ms |
| Slowest | 2,127.10 ms |
| Range | 65.80 ms |
| Throughput | 23.44 MP/s |
Encoding to JPEG was cheap by comparison
JPEG at quality 92 took 818.5 ms to encode. Combined with the measured pixel decode, the approximate end-to-end pipeline was 2.91 seconds.
WebP was the surprise
WebP produced the smallest output of the three formats, but the browser spent dramatically longer encoding it. Including HEIC decoding, the full pipeline was approximately 13.84 seconds.
PNG was fast to encode, but huge
PNG encoded substantially faster than WebP but produced a file more than ten times larger than the original HEIC. That is not really a failure of PNG: lossless PNG is simply a poor fit when the objective is compact photographic storage.
The full comparison
| Conversion | Decode | Encode | Output | Total |
|---|---|---|---|---|
| HEIC → JPEG | 2.09 s | 819 ms | 11.24 MB | 2.91 s |
| HEIC → WebP | 2.09 s | 11.75 s | 9.74 MB | 13.84 s |
| HEIC → PNG | 2.09 s | 1.40 s | 71.93 MB | 3.49 s |
Output size tells a different story
| Format | Output size |
|---|---|
| Original HEIC | 6.81 MB |
| JPEG | 11.24 MB |
| WebP | 9.74 MB |
| PNG | 71.93 MB |
Raw benchmark data
| Run | Pixel decode |
|---|---|
| 1 | 2066.10 ms |
| 2 | 2114.30 ms |
| 3 | 2065.70 ms |
| 4 | 2061.30 ms |
| 5 | 2069.70 ms |
| 6 | 2112.50 ms |
| 7 | 2084.30 ms |
| 8 | 2127.10 ms |
| 9 | 2107.00 ms |
| 10 | 2076.70 ms |
What the benchmark actually tells us
Methodology
The benchmark used a real 48.77-megapixel HEIC image. The image was decoded inside the browser using a WebAssembly HEIC decoder. The resulting pixels were placed into an RGBA ImageData buffer and then encoded through the browser's canvas encoding pipeline.
JPEG and WebP were encoded at quality 92. PNG used the browser's lossless encoding path. Decode timing was measured separately from output encoding so that the cost of the input format could be distinguished from the cost of the output format.
The figures represent this specific browser, machine, image and implementation. They should not be interpreted as universal performance figures for every browser or HEIC decoder.
Caveats and limitations
This is one benchmark, not a universal ranking of image formats. Results can change significantly with CPU architecture, browser version, operating system, WebAssembly implementation, image dimensions, image content, encoder settings and memory availability.
The most useful next experiment would test multiple images at 12 MP, 24 MP, 48 MP and 50+ MP. That would let us investigate whether decode time scales roughly linearly with pixel count and whether browser memory pressure becomes a significant factor at higher resolutions.
Conclusion
A 6.81 MB HEIC file can conceal nearly 186 MB of raw pixel data. In this test, decoding the image took approximately 2.09 seconds before output encoding even began.
JPEG added less than a second and produced an 11.24 MB file. PNG took about 1.40 seconds to encode but produced a 71.93 MB output. WebP was the outlier: its 9.74 MB output was the smallest, but encoding required 11.75 seconds.
The important lesson is that input file size is not the same thing as processing cost. A few megabytes on disk can represent tens or hundreds of megabytes of raw image data once decoded.
HEIC conversion tools
If you arrived here looking for the practical side rather than the benchmark, these are the main FileTools HEIC conversion routes:
Frequently asked questions
Why does a 7 MB HEIC require so much memory?
The HEIC file is compressed. To manipulate individual pixels, the browser must decode the image into an uncompressed representation. At four bytes per RGBA pixel, this 48.77 MP image requires approximately 186 MB for the raw pixel buffer alone.
Why was WebP so much slower than JPEG?
The result reflects the particular browser, encoder implementation, image and quality setting used in this experiment. It should not be interpreted as evidence that WebP is always slower than JPEG.
Why was the PNG output so large?
PNG is lossless and is not designed primarily for compact photographic compression. A high-resolution photograph can therefore produce a much larger PNG than its original HEIC representation.
Does this mean browser-based HEIC conversion is bad?
No. It means browser-based conversion has real computational costs that are easy to hide behind a simple upload button. WebAssembly makes local processing possible without uploading the original file to a server, but the user's device still has to do the work.