DEV Community

尚毅段
尚毅段

Posted on Edited on

Two screens, two aspect ratios: what changes when you cut a wallpaper twice

Most wallpaper advice assumes one display. The iPhone Duo has two, and they are not the same shape.

Apple lists the inner panel at 1878 x 2670 and the cover at 1398 x 2034. Written the way you actually hold the phone open, that gives three rectangles:

Surface Pixels Ratio (w/h)
Inner, open and sideways 2670 x 1878 1.4217
Inner, open and upright 1878 x 2670 0.7034
Cover, closed 1398 x 2034 0.6873

The last two matter. The cover is 2.3% narrower than the inner screen. That is small enough to miss in a mockup and large enough to notice on a photograph: a subject that sits comfortably on the inside creeps toward the edge once the phone is closed.

There is a second problem the ratio table does not show. The hinge runs through the middle of the inner display. Crop a photo once, centred, and whatever you care about is sitting on the fold.

Cut twice, do not resize

A single file resized for two screens keeps the whole frame and either squashes it or letterboxes it. A second crop keeps the same pixels at native scale and throws away a different part of the frame. That is the difference between a photo that works on both screens and one that is merely present on both.

So one master produces three files: 2670 x 1878 for the open inner display, 1398 x 2034 for the cover, and a 3840 x 2700 master in the inner ratio if you want room to move the subject later without upscaling.

The box math

def crop_box(src_w, src_h, target_w, target_h, focus_x=0.5):
    """Largest box of the target ratio that fits inside the source."""
    target_ratio = target_w / target_h
    if src_w / src_h > target_ratio:      # source is wider than the target
        w, h = round(src_h * target_ratio), src_h
    else:                                  # source is taller than the target
        w, h = src_w, round(src_w / target_ratio)
    left = round((src_w - w) * focus_x)
    top = round((src_h - h) * 0.5)
    return left, top, left + w, top + h


def crosses_crease(box, src_w, band=0.10):
    """True when the crop overlaps the middle 10% of the width."""
    x0, x1 = box[0], box[2]
    mid, half = src_w / 2, src_w * band / 2
    return x0 < mid + half and x1 > mid - half
Enter fullscreen mode Exit fullscreen mode

Run it on a 6000 x 4000 master with a centred focus:

cover = crop_box(6000, 4000, 1398, 2034)
print(cover)                        # (1626, 0, 4375, 4000)
print(crosses_crease(cover, 6000))  # True
Enter fullscreen mode Exit fullscreen mode

A centred crop of any landscape photo always crosses the crease band, because the band is the middle of the image and a centred crop always contains the middle. The function is not there to pass or fail the crop. It is there to tell you that focus_x has to move before the subject is clear of the fold.

What this costs in practice

I run a small wallpaper gallery for this phone, and every image in it goes through the same two crops. A centred crop can look fine as a thumbnail and wrong the moment a face sits on the fold. Nothing changes but the crop rectangle: same source photo, same file sizes, and the picture stops working on one of the screens.

If you are building anything that previews a wallpaper, show both states before the download button. One full-width frame and one small closed-phone frame is enough — the mismatch is visible in under a second, and it saves the user from discovering it after they set the wallpaper.

The exact pixel pairs, plus what happens when iOS gets the wrong file, are in the iPhone Duo wallpaper size guide. That page is the table I check whenever I add an image, so it is also the page I send people who ask why one file is not enough.

Top comments (0)