happytails.ai

Edge halo cleanup

Open Edge halo cleanup on Happytails.ai. This view has the same page content and links, with explicit tool capabilities. Read the processing notes before using a tool.

Tool capabilities

{
  "id": "edge-halo-cleanup",
  "category": "image-tools",
  "built": true,
  "requirements": "Images stay in this browser and are never uploaded. Use one still PNG, JPEG or WebP image up to 20 MiB, 16,384 pixels per side and 8 million pixels. Edge band 1 to 64 pixels, lowest alpha 1 to 254. Processing stops after 30 seconds. You get the cleaned PNG, a changed-pixel PNG and a JSON report. Source metadata and color profiles are not copied.",
  "implementation": {
    "fields": [
      {
        "key": "matte",
        "label": "Matte color the cutout was made on",
        "value": "#ffffff",
        "type": "color"
      },
      {
        "key": "edgeWidth",
        "label": "Edge band width in pixels",
        "value": "2",
        "type": "number",
        "min": 1,
        "max": 64,
        "step": 1
      },
      {
        "key": "minAlpha",
        "label": "Lowest alpha to clean (1 to 254)",
        "value": "16",
        "type": "number",
        "min": 1,
        "max": 254,
        "step": 1
      }
    ],
    "registrationFamily": "raster-masks-and-textures",
    "files": true,
    "input": false,
    "multiple": false,
    "accept": ".png,.jpg,.jpeg,.webp",
    "maxFileBytes": 20971520,
    "deferImagePreview": true,
    "note": "Images are processed in this browser and never uploaded. Use still PNG, JPEG or WebP files up to 20 MiB each.",
    "experience": {
      "automatic": false,
      "single": true,
      "inputMaxLength": 1000000,
      "inputMode": "text",
      "label": "Transparent cutout",
      "placeholder": "Choose a PNG with a transparent background",
      "help": "One still image up to 20 MiB and 8 million pixels. Up to 1,000,000 characters. Review the settings before running.",
      "helpParts": [
        "One still image up to 20 MiB and 8 million pixels.",
        "Up to 1,000,000 characters.",
        "Review the settings before running."
      ],
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}

Page guide

Remove the white, black or colored fringe left around a transparent cutout by taking the old background color back out of the soft edge pixels. Download the cleaned cutout as a PNG with a map of the pixels that changed.

How to use Edge halo cleanup
  1. Choose a transparent PNG cutout.
  2. Pick the matte color the cutout was originally on, such as white for a product shot on a white background.
  3. Set how many pixels in from the transparent area to clean.
  4. Run the tool, check the changed-pixel map and download your PNG.

Useful next steps

How the fringe is removed

A soft edge pixel is a mix of the subject color and the old background: shown color = alpha x subject + (1 - alpha) x matte, the "over" operation from Porter and Duff, "Compositing Digital Images", SIGGRAPH 1984. The tool solves that equation for the subject color, F = (C - (1 - alpha) x M) / alpha, in encoded sRGB, and keeps the alpha value exactly as it was.

Which pixels change

Only partly transparent pixels within the edge band of a fully transparent pixel are cleaned, measured in whole pixels including diagonals. Fully opaque and fully transparent pixels never change, and pixels below the lowest alpha setting are left alone because their color is too uncertain. The changed-pixel map shows every cleaned pixel in white.

Limits of the method

The method assumes the cutout was made against one uniform matte color. Hair, smoke and motion blur shot against a busy background can lose detail or keep some fringe. Use PNG for exact results: browsers round partly transparent colors when they decode WebP or color-managed files.