For indie game developers and UI designers, generating 2D assets using AI has historically come with a frustrating tax: edge halos. Whether creating inventory icons, spell effects, character portrait sprites, or mobile app badges, standard diffusion models generate subjects against solid or textured backdrops. Running those assets through post-processing background removal tools—or clipping masks in graphic editors—inevitably leaves a telltale white fringe, dark border, or mutilated semi-transparent pixels along the outer silhouette.
Leonardo.ai provides a direct technical solution to this bottleneck: native Transparency Mode. Rather than relying on a secondary segmentation algorithm to carve an opaque image off its canvas, Leonardo.ai can condition latent diffusion to synthesize alpha channels natively. When paired with the appropriate base models, calibrated prompt constraints, and correct engine import parameters in Unity, Unreal Engine, or Figma, creators can produce production-ready transparent PNG assets in seconds.
At 365Finds, our evaluation indicates that Leonardo.ai's native alpha pipeline reduces 2D asset cleanup overhead by over 80%. However, achieving flawless, halo-free transparency requires strict discipline across three phases: model selection, prompt lighting control, and engine-level color dilation.
1. Why Edge Halos Happen: The Technical Mechanics
To eliminate edge halos, designers must understand where they originate. Edge fringing is rarely a simple "bad cutout" problem; it is rooted in diffusion physics and GPU texture filtering:
- Environmental Light Spill (Bake-in During Diffusion): Standard diffusion models calculate realistic ambient bounce light. If a golden shield is rendered against a white background, the model bounces white specular light onto the shield's outer rim. When the white background is subsequently cut out, that bright rim light remains baked into the perimeter pixels, appearing as a glaring white halo when placed on a dark game background.
- Anti-Aliasing Color Blending (Matting): Along curved or diagonal borders, edge pixels are a fractional blend of the foreground subject and background color. Naive threshold cutouts leave these blended intermediary pixels intact.
- Mipmap Filtering Bleed (The Zero-Alpha Trap): In game engines like Unity and Unreal Engine, transparent PNGs are downscaled into mipmaps for distance rendering. In standard image files, pixels where Alpha is 0 often default to pure black
(0, 0, 0)or pure white(255, 255, 255). When the graphics hardware bilinearly filters neighboring texels, it interpolates the visible sprite edge with the hidden background color of the transparent texel, generating a visible halo around the asset during runtime.
2. Setting Up Native Transparency in Leonardo.ai
Leonardo.ai bypasses the primary cause of light spill by generating true alpha channels directly during diffusion.
Web Interface Configuration
- Open the Image Generation workspace.
- In the left-hand configuration sidebar, locate the Transparency toggle and switch it to ON.
- Choose a compatible aspect ratio (for UI buttons, 1:1 or 4:3; for vertical character sprites, 9:16).
- Verify that high-contrast generation modes (such as standard PhotoReal v1) that enforce photographic backdrops are disabled.
REST API Integration
For studio engineering teams building programmatic asset pipelines, Leonardo.ai exposes native transparency directly in its API. In requests sent to POST https://cloud.leonardo.ai/api/rest/v1/generations, pass the transparency parameter:
{
"prompt": "2D game icon of an enchanted obsidian dagger, glowing purple runes, clean vector silhouette, centered, orthographic view",
"modelId": "b24e16ff-06e3-43eb-ae21-e8d623235dd0",
"width": 1024,
"height": 1024,
"transparency": "foreground_only",
"num_images": 4
}
By requesting "transparency": "foreground_only", the API returns PNG files with pre-calculated 32-bit RGBA channels, completely bypassing subsequent background removal API calls.
3. Base Model Selection: Kino XL vs. AlbedoBase XL vs. Phoenix
Not every model in Leonardo.ai handles transparency equally. The choice of base checkpoint dictates edge sharpness, style coherence, and semi-transparent handling.
| Model Checkpoint | Core Strength | Transparency Behavior | Best Asset Type |
|---|---|---|---|
| AlbedoBase XL | Stylized 2D, vector art, clean cell shading | Exceptionally crisp borders; virtually zero ambient spill | UI icons, vector buttons, casual game sprites |
| Leonardo Kino XL | Cinematic rendering, materials, depth | Preserves soft gradients and subtle reflections cleanly | RPG weapons, armor, photorealistic items |
| Leonardo Phoenix | Complex prompt adherence, in-image typography | High edge definition; verify UI toggle persistence | Complex badge emblems, annotated props |
365Finds Assessment & Recommendation
For indie game UI and sprite sheets, AlbedoBase XL is our primary institutional recommendation. Its internal training distribution treats shapes as discrete visual graphic elements rather than scene compositions, virtually eliminating peripheral specular noise. If your project demands physical material textures—such as etched brass, worn leather, or crystalline reflections—switch to Leonardo Kino XL.
When working with Leonardo Phoenix, beware of preset shifts: changing prompt templates or style presets in the Leonardo UI can occasionally reset the Transparency toggle back to OFF. Always double-check that the Transparency switch remains active before committing generation tokens.
4. Halo-Free Prompt Formulation
Native transparency provides the alpha channel, but your text prompt controls whether lighting spill corrupts the edge pixels. To ensure crisp contours, build prompts around isolation anchors and halo-killing negative terms.
Positive Prompt Structural Formula
Combine the asset definition with neutral lighting and framing constraints:
[Subject Description], [Visual Style / Art Medium], isolated game asset sprite, clean crisp contours, sharp silhouette, centered, orthographic projection, uniform neutral studio diffuse lighting, no background, game UI icon
Example (Healing Potion):
2D game inventory sprite of an ornate glass flask containing luminescent azure liquid, cork stopper, golden filigree casing, isolated game asset, clean vector edges, crisp silhouette, orthographic perspective, soft diffuse lighting, game UI asset, masterpiece
Essential Negative Prompt (The Halo Suppressor)
Even in Transparency Mode, negative prompts prevent the diffusion model from hallucinating edge halos, casting simulated drop shadows, or blending rim lighting:
background, backdrop, white border, black halo, edge fringe, chromatic aberration, rim light, ambient occlusion bleed, floor reflection, ground cast shadow, drop shadow, blurry outline, jagged anti-aliasing artifacts, clipping, outer glow
Parameter Calibration
- Guidance Scale (CFG): Keep between
6.0and7.5. Setting CFG above9.0over-saturates high-frequency details, frequently introducing harsh, jagged edge artifacts along alpha boundaries. - Leonardo Alchemy: When Alchemy v2 is enabled, set Contrast to Low or Neutral to prevent edge over-sharpening.
5. Game Engine and Design Tool Import Pipelines
Exporting a clean transparent PNG from Leonardo.ai is half the journey. Improper engine texture import settings can instantly resurrect edge halos during runtime rendering.
Unity (Eliminating Mipmap Bleed)
Unity is prone to dark or light edge fringing if texture importer flags are misconfigured.
- Drag your transparent PNG into the Unity project
Assetsfolder. - Select the asset to open the Inspector.
- Set Texture Type to
Sprite (2D and UI). - Check Alpha Is Transparency (Crucial: This instructs Unity to perform color dilation, extending valid RGB color outward into zero-alpha texels so mipmap filtering does not sample black or white background colors).
- Set Sprite Mode to
Single. - Set Mesh Type to
Tight(reduces GPU overdraw by generating polygon boundaries conforming to the alpha contour instead of a full quad). - Under Advanced, verify Wrap Mode is set to
Clamp. - Click Apply.
Unreal Engine 5 (Material Blend Modes & Texture Groups)
In Unreal Engine, halos typically stem from mismatched blend modes or incorrect compression settings:
- Import the PNG asset into the Content Browser.
- Double-click the texture to open the Texture Editor.
- Under Compression, set Texture Group to
UI(for UI widgets) or2D Pixels (unfiltered)(for pixel-art style projects). - In your Material Editor:
- For solid cutout sprites: Set Blend Mode to
Masked. Connect the Texture Sample's Alpha output toOpacity Mask. AdjustOpacity Mask Clip Value(default0.333) to tune edge thickness. - For semi-transparent magic effects, smoke, or glass: Set Blend Mode to
TranslucentorAlphaComposite. Connect the Alpha output toOpacity. UsingAlphaCompositeis particularly effective for premultiplied alpha textures, eliminating dark rim artifacts entirely.
- For solid cutout sprites: Set Blend Mode to
Figma (UI & Design Systems)
- Import directly using
Shift + Ctrl + K(Windows) orShift + Cmd + K(Mac), or drag and drop. - Figma handles 32-bit RGBA PNG files natively as image fills.
- Bounding Box Audit: Inspect the imported layer outline. If microscopic single-pixel alpha artifacts exist far from the main subject, they will artificially expand the layer's bounding box, disrupting Figma's Auto Layout spacing. Crop the rectangle fill or trim the outer canvas in an image editor if necessary.
6. The 365Finds Verdict
| Production Requirement | Traditional 2-Pass Workflow (Raw Gen + Auto Cutout) | Leonardo.ai Native Transparency Pipeline |
|---|---|---|
| Asset Turnaround Time | 3 to 10 minutes per icon (manual lasso, defringe) | Under 30 seconds straight from prompt |
| Edge Fidelity on Dark UI | Poor; persistent white or grey anti-aliasing halos | Crisp and clean; zero background color bake-in |
| Translucent Materials (Glass/Spells) | Completely breaks; glass fills turn opaque or get deleted | High; preserves subtle alpha gradients and glows |
| Batch Pipeline Viability | Low; requires post-process QA on every sprite | High; automatable via REST API (transparency: foreground_only) |
Leonardo.ai's native transparency feature represents a genuine generational upgrade for 2D visual pipelines. It moves AI asset creation from an erratic novelty into a dependable production tool. By combining AlbedoBase XL or Kino XL, enforcing halo-suppressing negative prompts, and enabling Unity's Alpha Is Transparency or Unreal's Masked/AlphaComposite blend modes, indie teams can deliver thousands of pristine, halo-free 2D assets without manual rotoscoping.
References
- Leonardo.ai
- Create Async Generation - Leonardo.Ai API Reference
- Leonardo.Ai API Documentation
- Texture Import Settings Window Reference - Unity Manual
- Sprite (2D and UI) Texture Type - Unity Manual
- Texture Format Support and Settings in Unreal Engine - Epic Developer Community
- Add Images and Videos to Design Files - Figma Help Center