Extend a photo

How it works

What happens when you pull an edge

Everything below runs in your browser tab. The photo is never sent anywhere.

1. A bigger canvas, the photo untouched

When you drag an edge or choose a size, ExtendPhoto works out a new canvas and where the photo sits on it. The photo's own pixels are copied in once and never altered — only the strips around it are new. Each strip (top, right, bottom, left; the corners belong to the top and bottom strips) is filled by the method you chose for that side.

While you drag, the preview uses quick fills so it can keep up with your finger; when you let go, the chosen fill is computed on a smaller copy for the preview. The download is always built at full size.

2. Smart fill: patches from your own photo

Smart fill is a multi-scale patch synthesis written for this site. It works like this:

  • Start rough. A small copy of the canvas is made (about 200 pixels across). The new area is first painted with the colour of the nearest photo edge, softened — so a sky starts out as the colour the sky had at the edge.
  • Find matching patches. For every small square that touches the new area, a randomised search with propagation looks through the photo for the most similar square. Neighbouring squares are nudged to copy neighbouring pieces, which keeps whole runs of brick, grass or ripples intact instead of a jumble.
  • Vote. Each new pixel becomes a weighted blend of every patch covering it; better matches count more. Repeat a few times, then move to a copy twice as big and do it again, carrying the matches up.
  • Full detail. On large photos the last steps run at reduced size, and the matches are carried up to full size, where every new pixel is copied from the full-resolution original — so the texture stays crisp on a 24-megapixel print.

Because it only ever copies what's in the photo, smart fill can't invent things — no new trees, faces or words. It is best for skies, walls, grass, sand, water, foliage, fabric and studio backdrops. Try another smart fill re-runs it with a different random start.

3. Seam match

A copied strip can come out a shade lighter or darker than the photo beside it, and the eye catches that line at once. After a smart or AI fill, ExtendPhoto compares a thin band of photo with a thin band of new picture along the whole join, smooths that difference along the edge so no detail is imprinted, and shifts the new strip's brightness and colour to match — fully at the join, easing off towards the outer edge. The Seam match slider controls the strength.

4. The quick fills

  • Stretch repeats the outermost row or column, blurred more the further it goes.
  • Mirror reflects the photo at each edge (and at the corners in both directions).
  • Soft blur blurs a mirrored canvas heavily; the Blur slider sets how much.
  • Colour uses the average colour of each edge, or one colour you pick. Fade starts from the edge colours and fades into it.
  • Transparent leaves the new area see-through (saved as PNG or WebP).
  • Soft join blends the first few percent of any fill with the stretched edge, for a gentler transition.

5. AI fill (optional)

AI fill uses MI-GAN inpainting (512 × 512), licensed MIT (MI-GAN, Picsart AI Research). When you ask for it, the 26.6 MB model file is downloaded from our model file server, checked against its SHA-256 fingerprint and kept in your browser's storage. It runs on your device with ONNX Runtime Web — on the GPU through WebGPU where available, otherwise on the CPU through WebAssembly.

The canvas (scaled to at most 1024 pixels on its long side) is covered with overlapping 512 × 512 squares, processed nearest the photo first. Each square is given the photo plus everything generated so far, so far corners grow out of near ones. The result is scaled to full size and passed through seam match. Another version shows the model a mirrored view, which makes it paint differently.

6. Keeping people out of the new edges (optional)

PP-HumanSeg person segmentation (192 × 192) (6.2 MB, Apache-2.0 (PaddleSeg, via the OpenCV model zoo)) marks where a person is in the photo. That area is then excluded from everything the fills read: smart fill never copies those pixels, the AI is not shown them, and stretch, mirror and blur work from a copy of the photo with the person painted out by interpolating the surrounding background. The person in your photo is not changed.

7. Honest limits

  • Smart fill copies; it cannot invent. Adding more than about half the photo's size can make texture repeat.
  • A strong sky gradient may not carry on past the darkest colour in the photo — Fade or AI fill can look better there.
  • Where two different bands meet at a corner (a wall above pavement), the corner can mix them. Try another smart fill, or choose a different fill for that side.
  • AI fill draws at up to 1024 pixels and is softer than the photo on large prints. It cannot finish a person who is cut off at the edge.

8. Saving

The finished canvas is encoded by your browser as JPG, PNG or WebP. For print sizes, and whenever you work in centimetres or inches, the chosen DPI is written into the JPG or PNG header so print software shows the right physical size. Results up to 48 megapixels can be built.

Try it on a photo →