Zum Inhalt
HALOWERK

Medienwerk

bg remove

Takes an image by URL or inline base64 and returns it with the background removed, as PNG or WebP with a real alpha channel, together with the share of the frame that survived, the bounding box of the remaining subject and the option to crop to it.

POST https://medien.halowerk.com/v1/bg-remove

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
sourceobjectJaThe image. Either url or content_base64.
formatstringNeinOutput format. Both carry an alpha channel; WebP is markedly smaller.
alpha_mattingbooleanNeinRefine the edge for hair and fur. Slower, and not always better — compare before using it by default.
crop_to_subjectbooleanNeinCrop the result to the bounding box of what remained.
max_widthintegerNeinScale the result down so the width fits. Never scales up.
qualityintegerNeinFor WebP output.
Vollständiges Eingabeschema anzeigen
{
  "type": "object",
  "required": [
    "source"
  ],
  "additionalProperties": false,
  "properties": {
    "source": {
      "type": "object",
      "additionalProperties": false,
      "description": "The image. Either url or content_base64.",
      "properties": {
        "url": {
          "type": "string",
          "maxLength": 2048,
          "description": "Public http(s) URL of the image."
        },
        "content_base64": {
          "type": "string",
          "maxLength": 12000000,
          "description": "The image inline, base64."
        },
        "filename": {
          "type": "string",
          "maxLength": 260
        }
      }
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "webp"
      ],
      "default": "png",
      "description": "Output format. Both carry an alpha channel; WebP is markedly smaller."
    },
    "alpha_matting": {
      "type": "boolean",
      "default": false,
      "description": "Refine the edge for hair and fur. Slower, and not always better — compare before using it by default."
    },
    "crop_to_subject": {
      "type": "boolean",
      "default": false,
      "description": "Crop the result to the bounding box of what remained."
    },
    "max_width": {
      "type": "integer",
      "minimum": 32,
      "maximum": 4000,
      "description": "Scale the result down so the width fits. Never scales up."
    },
    "quality": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 90,
      "description": "For WebP output."
    }
  }
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "source": {
    "content_base64": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAB00lEQVR42u3d0VEDMQxFUaKhBVqgJIpMSbRAEUsLGViv5LfnfudD0vWzs5kkfhzH8YY+yggIIAAEEAACCAABBIAAAkAAASCAABBAAAggAAQQAAIIAAEE4Fze9yr34+v7lZf9PD936egx/6uJLw59UxlzBfxz7ruYmCjg9NFP1jBLwNLRz9QwRcBlo5+moV9Ay+jnaKibT7+9hrr59Nsr6dmC5oy+fTsq0++trUy/t8Iy/d46y/R7q/VxdDNl+ffWXKbfW3mZfm/9zoDoM2D35X9BFxKQm4CM5b+6FwkITUDS8l/akQQkJiBv+a/rSwKinwPQICB1/1nUnQTYgghAjoDsA2BFjxJgCyIABBAAAggAAQSAAAJAAAF/ZKN/yRjSowTYgghAlIDsY+D07iTAFkSAXaixLwkI3YLyQrCoIwnIPYSTQrCuFwmIfhuaEYKlXUhA+oPY7iFYXX8F9LB15RXTyaY1OwPSz4BNQ3BZtRXZ1UZ1VnBvW1RY8R0Or63z39NH/aCsa1nUDXseVUndtvMhNbhBoxl3yBBwrQa3KLVpcI9Yjwk36TXIcJckNnkOAAEEEAACCAABBIAAAkAAASCAABBAAAggAAQQAAIIAAEEYAG/AmS3w9j1ZhwAAAAASUVORK5CYII=",
    "filename": "blue-circle.png"
  },
  "format": "png",
  "crop_to_subject": false
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-01, 15:19 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →