Question 1 · choose 1
A travel site edits stock photos with a GPT-image model: only the sky should be replaced with a sunset, and every other pixel must stay as it is. You send the photo, a prompt and a mask to the image edit API. How must the mask be prepared?
- AA PNG at half resolution, fully transparent over the sky
- BA JPEG the same size as the photo, painted white over the sky
- CA PNG the same size as the photo, transparent everywhere except the sky
- DA PNG the same size as the photo, fully transparent over the sky
Show the answer and why
AA PNG at half resolution, fully transparent over the sky
Incorrect
The mask must have the same dimensions as the input image.
BA JPEG the same size as the photo, painted white over the sky
Incorrect
Masks are PNG files, and the editable area is defined by transparency, not by a white fill.
CA PNG the same size as the photo, transparent everywhere except the sky
Incorrect
That inverts the mask: transparent areas are the ones the model edits, so it would repaint everything but the sky.
DA PNG the same size as the photo, fully transparent over the sky
Correct
The mask marks the area to edit with fully transparent pixels (alpha of zero), must be a PNG and must match the input image's dimensions.
For inpainting, the mask tells the model where it may change pixels: fully transparent areas are edited, opaque areas are kept. Use a PNG with the exact dimensions of the source image.
Microsoft documentation