Memory sizing
Peak memory is about four RGBA buffers of the image plus the runtime: estimateMemoryMB(width, height) = ceil(megapixels × 16 + 256).
| Image | Megapixels | Estimate | Lambda size |
|---|---|---|---|
| 4000 × 3000 | 12 | 448 MB | 1024 MB |
| 6000 × 4000 | 24 | 640 MB | 1769 MB (a full vCPU) |
| 8660 × 5774 | 50 | 1056 MB | 2048 to 3008 MB |
The core is single-threaded, so the 1769 MB tier matters for speed as much as for memory. 100 megapixels is the practical ceiling of the 4 GB wasm32 address space. The handler rejects images above limits.maxMegapixels from the header alone, before decoding.