> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embededitor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Large Photos

> How the editor works photos over 16.7 MP, and how to keep phone uploads small.

Open 48 MP phone photos without running out of memory, and know which units your code gets back.

## The 16.7 MP Working Copy

The editor works on at most 16.7 MP of any photo (2^24 px, the area of 4096 × 4096). A larger photo is scaled down once, when it opens, keeping its ratio.

| Photo | Worked at |
| - | - |
| 48 MP (8064 × 6048) | 4729 × 3547 |
| 24 MP | 5016 × 3344 |
| 4160 × 4160 | 4096 × 4096 |

The screen, Auto, smart crop, the thumbnails and the export all use that copy. It's the same in every browser, for two reasons:

* **Memory on phones.** A full 48 MP photo takes more memory than a phone's browser tab may get.
* **Parity with the legacy editor**, which always worked at this size in Safari and on iOS.

## What Your Code Sees

| Where | Units |
| - | - |
| `onLoad` | `size` is the working size. `file` is the original, at its own size. |
| Saved state | In the working size's px. It reopens exactly on the same photo, in every browser. |
| A Pintura state | Its `crop` and `redaction` are read in the photo's own px, and land on the same region. |
| `processImage` | `crop` in the file's own px; the returned state in the working size's px. |

```tsx Editor.tsx theme={"dark"}
<EmbedEditor
	onLoad={({ file, size }) => {
		// a 48 MP photo: size is 4729 × 3547, file is the original
		console.info(size.width, size.height, file);
	}}
	src={src}
/>
```

> [!WARNING]
>
> Don't pass a saved state's `crop` to `processImage` as its `crop` option. Those px are the working copy's, not the file's.

## Memory

Measured on WebKit standing in for an iPhone 15, a 48 MP photo:

| 48 MP photo | Full size | At 16.7 MP |
| - | - | - |
| At rest | 0.84 GB | 0.44 GB |
| Peak through one Save | 2.78 GB | 1.17 GB |
| Save | 0.75–0.89 s | 0.23–0.31 s |
| Output | 8064 × 6048, 9.7 MB | 4729 × 3547, 3.4 MB |

The full file is still decoded once when it opens, which adds 0.29 GB to the opening peak and about 0.15 s before `onLoad`.

## Phones

Phones shoot 12 to 48 MP. To get smaller files from them, set `maxWidth` and `maxHeight` lower. The export renders straight at that size.

```tsx Upload.tsx theme={"dark"}
<EmbedEditor
	maxHeight={2048}
	maxWidth={2048}
	outputType='image/jpeg'
	src={src}
/>
```

* A HEIC from a phone saves as PNG unless `outputType` says otherwise.
* Safari decodes HEIC itself. Chromium and Firefox, Android's included, use a bundled decoder that loads only for a HEIC, in a background worker. A 48 MP HEIC takes about 8 s on a fast laptop, longer on a phone.
* Every gesture works with a finger, and controls reach at least 44 × 44 px under a finger.

> [card] [Crop & Aspect Ratio](https://docs.embededitor.com/features/crop.md)
>
> Output size and type props.

> [card] [Process Without UI](https://docs.embededitor.com/guides/process-image.md)
>
> Units in processImage.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.