{
  "title": "Edge halo cleanup",
  "human_url": "https://happytails.ai/en/image-tools/edge-halo-cleanup/",
  "agent_url": "https://happytails.ai/agents/en/image-tools/edge-halo-cleanup/",
  "language": "en",
  "markdown_url": "https://happytails.ai/en/image-tools/edge-halo-cleanup.md",
  "content": "Edge halo cleanup\nRemove 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.\nHow can we improve this tool?\nReport a problem or share an idea.\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\nHow to use Edge halo cleanup\nChoose a transparent PNG cutout.\nPick the matte color the cutout was originally on, such as white for a product shot on a white background.\nSet how many pixels in from the transparent area to clean.\nRun the tool, check the changed-pixel map and download your PNG.\nUseful next steps\nRemove background\nTrim transparent image margins\nSplit and combine image channels\nHow the fringe is removed\nA 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.\nWhich pixels change\nOnly 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.\nLimits of the method\nThe 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.",
  "content_format": "text/plain",
  "visibility": "public",
  "links": [
    {
      "name": "Remove background",
      "url": "https://happytails.ai/en/image-tools/remove-background/"
    },
    {
      "name": "Trim transparent image margins",
      "url": "https://happytails.ai/en/image-tools/transparent-image-trim/"
    },
    {
      "name": "Split and combine image channels",
      "url": "https://happytails.ai/en/image-tools/image-channel-splitter/"
    }
  ],
  "tool": {
    "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.",
        "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"
    }
  },
  "markdown": "# Edge halo cleanup\n\n- Human page: https://happytails.ai/en/image-tools/edge-halo-cleanup/\n- Markdown: https://happytails.ai/en/image-tools/edge-halo-cleanup.md\n- Structured JSON: https://happytails.ai/agents/en/image-tools/edge-halo-cleanup/index.json\n- Visibility: public\n\n## Tool capabilities\n\n| Property | Value |\n| --- | --- |\n| Tool ID | `edge-halo-cleanup` |\n| Category | image-tools |\n| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |\n| Browser execution | Use the visible action or interactive controls. |\n| Browser processing | Browser; see tool notes for network behavior. |\n| HTTP API | Not callable through HTTP. |\n| Browser-agent interface | run_current_tool |\n\n### Implementation notes\n\nImages are processed in this browser and never uploaded. Use still PNG, JPEG or WebP files up to 20 MiB each.\n\n### Inputs and settings\n\nNo free-text input is required. Use the file inputs and/or settings below.\n\nAccepted browser files: `.png,.jpg,.jpeg,.webp`. Choose one file.\n\nBrowser file-input limit: 20971520 bytes in total. HTTP limits can differ.\n\n| Setting | Meaning | Control type | Default | Constraints |\n| --- | --- | --- | --- | --- |\n| `matte` | Matte color the cutout was made on | color | \"#ffffff\" |  |\n| `edgeWidth` | Edge band width in pixels | number | \"2\" | min=1 max=64 step=1 |\n| `minAlpha` | Lowest alpha to clean (1 to 254) | number | \"16\" | min=1 max=254 step=1 |\n\n### Browser-agent workflow\n\n1. Open the human page in a browser that supports WebMCP.\n2. Discover the interface exposed by that page; use its actual schema.\n3. Select files on the page first when the tool requires files.\n4. Call `run_current_tool` with valid input and settings.\n5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.\n\nCalls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.\n\n### Planning specification\n\nImages 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.\n\nThis describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.\n\n### Complete machine-readable capability record\n\n```json\n{\n  \"id\": \"edge-halo-cleanup\",\n  \"category\": \"image-tools\",\n  \"built\": true,\n  \"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.\",\n  \"implementation\": {\n    \"fields\": [\n      {\n        \"key\": \"matte\",\n        \"label\": \"Matte color the cutout was made on\",\n        \"value\": \"#ffffff\",\n        \"type\": \"color\"\n      },\n      {\n        \"key\": \"edgeWidth\",\n        \"label\": \"Edge band width in pixels\",\n        \"value\": \"2\",\n        \"type\": \"number\",\n        \"min\": 1,\n        \"max\": 64,\n        \"step\": 1\n      },\n      {\n        \"key\": \"minAlpha\",\n        \"label\": \"Lowest alpha to clean (1 to 254)\",\n        \"value\": \"16\",\n        \"type\": \"number\",\n        \"min\": 1,\n        \"max\": 254,\n        \"step\": 1\n      }\n    ],\n    \"registrationFamily\": \"raster-masks-and-textures\",\n    \"files\": true,\n    \"input\": false,\n    \"multiple\": false,\n    \"accept\": \".png,.jpg,.jpeg,.webp\",\n    \"maxFileBytes\": 20971520,\n    \"deferImagePreview\": true,\n    \"note\": \"Images are processed in this browser and never uploaded. Use still PNG, JPEG or WebP files up to 20 MiB each.\",\n    \"experience\": {\n      \"automatic\": false,\n      \"single\": true,\n      \"inputMaxLength\": 1000000,\n      \"inputMode\": \"text\",\n      \"label\": \"Transparent cutout\",\n      \"placeholder\": \"Choose a PNG with a transparent background\",\n      \"help\": \"One still image up to 20 MiB and 8 million pixels. Up to 1,000,000 characters. Review the settings before running.\",\n      \"action\": null\n    },\n    \"mode\": \"explicit\",\n    \"interactive\": false\n  },\n  \"execution\": \"Browser interface\",\n  \"api\": null,\n  \"browser_agent\": {\n    \"supported\": true,\n    \"name\": \"run_current_tool\",\n    \"discovery\": \"WebMCP on the human page in a supporting browser\",\n    \"verification\": \"See audit/API-AUDIT.md; availability is not verification\"\n  }\n}\n```\n\n## Page guide\n\nRemove 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.\n\nHow can we improve this tool?\n\nReport a problem or share an idea.\n\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\n\n### How to use Edge halo cleanup\n\n1. Choose a transparent PNG cutout.\n2. Pick the matte color the cutout was originally on, such as white for a product shot on a white background.\n3. Set how many pixels in from the transparent area to clean.\n4. Run the tool, check the changed-pixel map and download your PNG.\n\n## Useful next steps\n\n- [Remove background](https://happytails.ai/en/image-tools/remove-background/) ([Markdown](https://happytails.ai/en/image-tools/remove-background.md))\n\n- [Trim transparent image margins](https://happytails.ai/en/image-tools/transparent-image-trim/) ([Markdown](https://happytails.ai/en/image-tools/transparent-image-trim.md))\n\n- [Split and combine image channels](https://happytails.ai/en/image-tools/image-channel-splitter/) ([Markdown](https://happytails.ai/en/image-tools/image-channel-splitter.md))\n\n## How the fringe is removed\n\nA 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.\n\n### Which pixels change\n\nOnly 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.\n\n### Limits of the method\n\nThe 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.\n"
}