When using a reference image through ChatGPT 4o image-gen you could return an image with a transparent background (i.e a die cut sticker). It looks like the transparent option is only available through the Generate endpoint, but not the Edit endpoint. Even prompting ‘transparent background’ doesn’t result in a transparent background.
Am I doing something wrong, or are there plans to introduce this?
The forum does that. You can only show or share preserved transparency by converting to a GIF with reduced color palette. Or you can use photo edit software to put a transparency grid behind just to demonstrate.
Here’s an example output through playground. It followed the PNG format request and provided a .png file, however the checkerboard background is fake and isn’t transparent.
Prompt
Create a digital die cut sticker in a 3D clay model inspired by characters like Wallace & Gromit, with rounded plastic features and sculpted textures based on the main uploaded subject image. The sticker should have a clean transparent background, a thick white outline around the subject, and be centered within a square canvas (1:1 aspect ratio). Guidelines - You must transform the subject into a style and not be photo-realistic. - You must remove the background completely and make it transparent and provide the final file in PNG format. Keep only the die cut sticker with a white solid white border. Output must be a cutout die cut sticker on a fully transparent background.
Are you explicitly setting it to output png transparent?
Use output_format="png" or "webp" and set background="transparent". Including “transparent background” in the prompt might also trigger this automatically (as per cookbook).
prompt_transparent_hat = “generate a pixel-art style picture of a green bucket hat with a pink quill on a transparent background.”
response = client.images.generate(
model="gpt-image-1",
prompt=prompt_transparent_hat,
size="1024x1024",
quality="low",
output_format="png", # Required for transparency
# background="transparent", # Can be explicitly set
response_format="b64_json",
n=1
)
More help here…
If you’re already setting it and it’s still not working, let us know.
prompt_mask_edit="make the dog green and in a jumping pose, and keep the transparent background"
result_sticker_edit = client.images.edit(
model="gpt-image-1",
prompt=prompt_mask_edit,
image=img_input,
quality="low",
size="1024x1024"
)