How to Generate a Transparent-Background PNG with AI
Ask almost any image model for "a logo on a transparent background" and you get a logo on a painted background. Every pixel is opaque, and the transparency is only cosmetic. It looks right until you drop it onto a dark site and a white box appears around it. If you have searched for a transparent background PNG generator and come away unimpressed, that is why.
The short version: today's models, including gpt-image-2, do not reliably produce a true alpha channel at generation time. The dependable method has two steps: generate the image, then remove the background. AgentBrush does both in one flow, and the removal step runs locally at zero token cost and always returns a real transparent PNG.
From your side it is a single request. Ask your agent for a transparent-background image and AgentBrush runs the whole workflow for you: it generates the subject on a clean background, then removes that background locally, and saves the finished PNG. Everything below is what it does under the hood, and why one request gives you a reliable, real cut-out instead of a fake one.
Why "just generate it transparent" does not work
Image models are trained to fill the canvas. Most do not expose an alpha channel when they generate, so when you ask for transparency you get a plausible-looking white or checkered fill instead of actual transparency. The pixels are all there. They are just pretending.
So the reliable approach splits the work in two:
- Generate the best possible subject, on a clean background that is easy to remove.
- Remove that background into a real alpha-channel PNG.
That separation is the whole trick, and it is how AgentBrush is built to work.
The 2-step workflow
Step 1: Generate on a clean background
Ask your agent for the subject, and steer it toward a plain, high-contrast background so the cut-out is crisp later. Match the preset to the asset: logo, pixel_art, flat_illustration, or realistic.
Generate a friendly robot mascot mid-jump on a flat coral background.
preset: realistic · quality: high · background: opaque
This part is counter-intuitive: set the background to opaque, not transparent. A clean, evenly lit backdrop in a flat color the subject does not contain gives the remover the easiest possible edge to trace. Our robot is white, so we use coral, not a white or cloudy sky it would blur into and leave holes in. You are optimizing the input for step 2, not trying to skip it.
Step 2: Remove the background
Now cut it out. AgentBrush runs this locally with an on-device segmentation model. It costs 0 tokens, never uploads your image anywhere, and always hands back a PNG with a real transparent alpha channel.
Remove the background from the robot image.
That is the whole step. You get your-image-no-bg.png, ready to sit on any background, whether that is a slide deck, a store listing, or a game engine, with no halo and no white box.
The local part matters more than it sounds. Cloud removers charge per image and want you to upload your asset first. Running it on your machine is free at any volume and private by default. If you are cutting out three hundred product shots, that is the difference between a line item and a non-event.
Doing it all inside Claude or Cursor
None of this involves a web app. AgentBrush is an MCP server, so your agent (Claude Code, Cursor, Codex CLI, Gemini CLI, or any MCP-compatible client) calls it directly. You describe what you want, your agent makes the calls, and the transparent PNG lands in your project folder. New here? The 2-minute setup is in the install guide.
What transparent PNGs unlock
Once clean cut-outs are a one-line request, a lot of asset work stops being work:
- Stickers and emotes: die-cut PNGs with no halo.
- Game sprites: characters and items isolated on transparency, ready to import. (See generating 2D game assets.)
- App icons: a centered mark with padding and transparent corners. (See generate app icons in Claude.)
- Product cut-outs: drop one product onto any lifestyle background.
- Logos and badges: overlay on any color with no white box.
Where it breaks down
No remover is magic, so aim it well:
- High contrast wins. A subject that separates cleanly from its background cuts out cleanly. Backgrounds that share the subject's colors give ragged edges.
- Fine edges are hard. Hair, fur, glass, and motion blur are the tough cases for any tool. A simpler silhouette gives a sharper result.
- Match the preset to the asset.
logofor marks,pixel_artfor sprites,realisticfor products. Each is tuned for the kind of edge you will be tracing. - Iterate cheaply. A low-quality draft costs a single token and removal is always free, so re-cut as many times as you like before committing to a high-quality final.
FAQ
Can AI generate a transparent background directly?
Not reliably today. gpt-image-2 and most models do not output a true alpha channel at generation time, so the dependable method is to generate on a clean background and then remove it.
Does removing the background cost tokens? No. AgentBrush's background removal runs locally, so it is free at any volume and does not upload your image anywhere.
What format is the output? A PNG with a real transparent alpha channel, the format that actually preserves transparency. A JPEG cannot, so do not let anyone sell you a "transparent JPEG".
Can I do this without leaving my code editor? Yes. AgentBrush is an MCP server, so Claude, Cursor, and other agents call it directly and save the transparent PNG straight into your project.