---
title: Extract Head Region from Image API
slug: extract-head-region
url: https://apyhub.com/dosvak/service/extract-head-region
provider: Dosvak LLC
tags: [image-processing, background-removal, portrait-cropping, transparent-image, photo-cutout]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 100
---

# Extract Head Region from Image API

Extract the head and shoulders from a portrait image and get a transparent image back. Built for avatars, profile photos, and photo cutouts.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/dosvak/extract-head-region` | What it does Extracts a head/shoulders region from a portrait image and returns the result as a bin… | 100 |

## Endpoint reference

### Extract a head/shoulders region with transparency

`POST https://api.eu.apyhub.com/dosvak/extract-head-region` · 100 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | Portrait image |
| `padding` | query | number | no | Default: `0.42`. Example: `0.42`. |

#### Quickstart

Upload a portrait image to extract the head region, with the default padding.

```bash
curl -X POST "https://api.eu.apyhub.com/dosvak/extract-head-region?padding=0.42" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/portrait.jpg"
```

#### What you'll get back

Returns a binary file (`string` with `format: binary`) containing the extracted head region.

## About

## What it does
Head Region Extractor takes a portrait image and returns the head and shoulders area with transparency. Send a single binary `file` in the request body, and optionally tune `padding` in the query to control how much of the surrounding area is kept around the subject.

Use it when you need a clean cutout for avatars, profile cards, staff directories, ID-style imagery, or any workflow that needs a subject isolated from the background. The service is designed for portrait photos and the output is a binary image, ready to store, forward, or post-process in your own pipeline.

The only input is the uploaded image file, capped at 20 MB, plus the optional `padding` value. The response is an image with transparency, so you can place the extracted head and shoulders onto different backgrounds without manual masking.

If your product handles user photos at scale, Head Region Extractor is a straightforward way to standardize portraits before resizing, compositing, or approval workflows.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/extract-head-region
