将 /Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2.png 修改为苹果接受的截图尺寸之一:1280 × 800、1440 × 900、2560 × 1600 或 2880 × 1800,并尽量减少图片质量损失。
2310 × 1192 PNG,非 16:10。2560 × 1600。2560 × 1600。/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png。1440 × 900 或 1280 × 800,因为会降低清晰度。2880 × 1800,因为会产生上采样。2560 × 1600 可以在不缩放原图的前提下补白,质量损失最小。/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2.png2310 × 1192 PNG。2560 × 1600 PNG。x=125, y=0,底部补白 408px。sips -g pixelWidth -g pixelHeight -g format /Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png 输出 pixelWidth: 2560、pixelHeight: 1600、format: png。file /Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png 输出 PNG image data, 2560 x 1600, 8-bit/color RGBA, non-interlaced。ImageChops.difference 验证原图嵌入区域与源图像素一致。用途:把非 16:10 官网截图补白为苹果接受的 2560 × 1600 PNG,同时不缩放、不裁切原图。
前置条件:本机 Python 环境可导入 Pillow。
设置命令:
python3 - <<'PY'
from pathlib import Path
from PIL import Image, ImageChops
src = Path('/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2.png')
out = Path('/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png')
img = Image.open(src).convert('RGBA')
canvas = Image.new('RGBA', (2560, 1600), (255, 255, 255, 255))
x = (2560 - img.width) // 2
y = 0
canvas.paste(img, (x, y), img)
crop = canvas.crop((x, y, x + img.width, y + img.height))
if ImageChops.difference(crop, img).getbbox() is not None:
raise SystemExit('verification failed: pasted content differs from source')
canvas.save(out, format='PNG', optimize=True)
print(f'wrote {out} with source offset x={x}, y={y}')
PY
验证步骤:
sips -g pixelWidth -g pixelHeight -g format /Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png
file /Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png
搜索关键词:App Store 截图尺寸、2560x1600、ImageChops、SCR-20260630-szrh-2
/Users/ar/Desktop/Screencapture/SCR-20260630-szrh-2-2560x1600.png 上传到苹果后台。