GitHub social preview 1280x640: generate it with an image API

GitHub's social preview is 1280x640 PNG, JPG or GIF under 1 MB. 1280x640 passes GPT Image 2.5's size rules on Sume; here is the request and the file-size step.

4 min readSume
All posts

GitHub's social preview image should be PNG, JPG or GIF under 1 MB, at least 640x320 and best at 1280x640. 1280x640 is a legal GPT Image 2.5 custom size on Sume, so you can request it directly with image_size: "1280x640". Check the file size afterward, because Sume does not serve output_compression.

GitHub's figures are from its docs page; Sume's from the Image API docs. Both read 2026-10-01.

What does GitHub require?

Per GitHub's page: PNG, JPG or GIF, under 1 MB, a 640x320 minimum, and 1280x640 for best display. Transparent PNGs are supported, but GitHub recommends a solid background so the card looks right on any page color.

Does 1280x640 pass the GPT size rules?

OpenAI's guide lists the GPT Image 2.5 custom-size rules: both edges multiples of 16, edges at most 3840, aspect ratio between 1:3 and 3:1, and 655,360 to 8,294,400 total pixels. Sume's Image API docs state the same limits for image_size on GPT models.

1280x640 against the GPT custom-size rules, read 2026-10-01 (our own arithmetic)
CheckResult
Edges multiples of 16Yes (80 x 16, 40 x 16)
Aspect ratio within 1:3 to 3:1Yes (2:1)
Pixels 655,360 to 8,294,400Yes (819,200)

What do I send?

Ask for a solid background and leave the lettering short. Request png for sharp text, or jpeg for a smaller file.

curl -X POST https://api.sume.com/v1/images \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2.5",
    "prompt": "Repository banner, dark navy background, large word 'ingest' in white, minimal line pattern",
    "image_size": "1280x640",
    "output_format": "png"
  }'

How do I stay under 1 MB?

Sume's docs say output_compression is in the schema but not served in v1; sending it returns 400 unsupported_parameter. If the PNG is over 1 MB, switch output_format to jpeg, or recompress the file with your own tool before uploading to GitHub.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume