Skip to content
HALOWERK

Media and Speech Processing

remove background

Remove background from image: background remover API that cuts out the main subject of a photo, product image, portrait or logo and returns a transparent PNG or WebP with alpha channel, plus the subject bounding box and an optional crop. Image by public URL or base64. Runs locally with rembg (U2-Net), the image is not sent to any third party and nothing is stored. 0.01 USDC per image.

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

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
sourceobjectYesThe image. Either url or content_base64.
formatstringNoOutput format. Both carry an alpha channel; WebP is markedly smaller.
alpha_mattingbooleanNoRefine the edge for hair and fur. Slower, and not always better — compare before using it by default.
crop_to_subjectbooleanNoCrop the result to the bounding box of what remained.
max_widthintegerNoScale the result down so the width fits. Never scales up.
qualityintegerNoFor WebP output.
Show full input schema
{
  "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."
    }
  }
}

Open original schema

Published input example

{
  "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
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-12-05 UTC.

More endpoints in this hub

All endpoints in this hub →