Implement computer vision solutions 3.1 Design and implement image- and video-generation solutions
An app generates banner images with gpt-image-2 and size=auto.
Study guide skill: Select and apply appropriate generation and editing controls provided by the platform
Question B7-009
An app generates banner images with gpt-image-2 and size=auto. A downstream video encoder rejects any image whose edges aren't multiples of 16 pixels, and some images are rejected. What should you do?
Select one answer.
Answer: D
For gpt-image-2, both edges must be multiples of 16 pixels, but those sizing constraints apply only when you specify a size. With size=auto, the generated image might have dimensions that don't meet them. quality only selects low, medium or high image quality, and n sets how many images a call returns; neither controls the dimensions.
Deep dive
How it works
gpt-image-2 supports arbitrary resolutions, within constraints. The constraint that matters here: both edges must be multiples of 16 pixels. The page also lists aspect-ratio, maximum-edge and total-pixel limits.
The catch is in a note: the sizing constraints only apply when you specify a size. With size=auto, the generated image might have dimensions that don't satisfy them; Microsoft's own example is an edge that isn't a multiple of 16 pixels. That's exactly why some banners fail at the encoder.
The fix is to stop letting the model choose. Pass an explicit size, with both edges multiples of 16, that fits the other constraints and your banner layout. Every image then comes back at dimensions the encoder accepts.
The other options, and when you'd use them
- Set n to 1: n is the number of images per call. One image is still sized by size=auto.
- Keep size=auto: Microsoft says auto might produce dimensions that don't satisfy the constraints, including edges that aren't multiples of 16.
- Set quality to high: The quality options are low, medium and high. They control image quality, not the dimensions.
Exam tip
Need guaranteed dimensions from gpt-image-2? Specify size explicitly (edges in multiples of 16). auto makes no promises.
References
Last reviewed: