FFileTools
FileTools Research

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

The test image

Our test file, IMG_1089.HEIC, was a high-resolution iPhone-style photograph measuring 8064 × 6048 pixels.

6.81 MBCompressed HEIC size
48.77 MPImage resolution
8064 × 6048Pixel dimensions
PropertyResult
FileIMG_1089.HEIC
File size6.81 MB
Width8,064 px
Height6,048 px
Total pixels48,771,072
Megapixels48.77 MP
Raw RGBA requirement186.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
6.81 MB → 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.

2,088.47 msMean decode time
2,080.50 msMedian
23.44 MP/sDecode throughput
MeasurementTime
Cold decoder initialization20.00 ms
First pixel decode2,073.90 ms
Mean2,088.47 ms
Median2,080.50 ms
Fastest2,061.30 ms
Slowest2,127.10 ms
Range65.80 ms
Throughput23.44 MP/s

Encoding to JPEG was cheap by comparison

818.5 msJPEG encode time
11.24 MBJPEG output
2.91 sApprox. HEIC → JPEG

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

11,748 ms encode time for a 9.74 MB output. That is approximately 14.4× the JPEG encoding time in this test.

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

1,397.4 msPNG encode time
71.93 MBPNG output
3.49 sApprox. HEIC → PNG

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

ConversionDecodeEncodeOutputTotal
HEIC → JPEG2.09 s819 ms11.24 MB2.91 s
HEIC → WebP2.09 s11.75 s9.74 MB13.84 s
HEIC → PNG2.09 s1.40 s71.93 MB3.49 s

Output size tells a different story

FormatOutput size
Original HEIC6.81 MB
JPEG11.24 MB
WebP9.74 MB
PNG71.93 MB

Raw benchmark data

RunPixel decode
12066.10 ms
22114.30 ms
32065.70 ms
42061.30 ms
52069.70 ms
62112.50 ms
72084.30 ms
82127.10 ms
92107.00 ms
102076.70 ms

What the benchmark actually tells us

27.32×Compressed-to-RGBA expansion
23.44 MP/sMeasured pixel decode throughput
14.4×WebP vs JPEG encode time
71.93 MBPNG output size
2.09 sAverage HEIC pixel decode
13.84 sHEIC → WebP pipeline

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.