Alpha channel

Capture with a transparent background instead of white

A logo card on white is a logo card on white forever. Without the backdrop, it is an asset.

omit_backgroundformatselectorimage_quality
curl --fail-with-body "https://api.pagecapture.dev/v1/take" \
  -H "X-Access-Key: $PAGECAPTURE_KEY" \
  -H "Content-Type: application/json" \
  --data '{"url":"https://example.com","format":"png","omit_background":true,"selector":"main"}' \
  -o capture.png

Verified 2026-08-13 by running the published code against a fixture.

Configure it in the playground
What you are seeing

You capture a component to composite into your own layout and it arrives welded to a white rectangle.

Why the page does that

Browsers paint a default white backdrop when the document has no background of its own. It is in the image because it was in the render.

What it does

  • Renders without the default backdrop, so anything the page does not paint stays transparent.
  • Preserves the alpha channel in every format that has one — PNG, WebP, AVIF and TIFF among the formats this build encodes.
  • Combines with `selector`, which is where it earns its keep: one component, no page behind it.

What it does not do

  • Does not remove a background the page itself paints. A `body` with a background colour is content, not backdrop — hide or override it with `styles`.
  • Does not survive a format without alpha. JPEG has no transparency, and the area composites against black or white depending on the encoder.
  • Does not apply to PDF, where the page model has no transparent canvas.
The contract

Every limit on this page is the one the API enforces

These rows are read from the same parameter table that validates your request. Nothing here is transcribed, so a number cannot drift from the behaviour it describes.

ParameterTypeDefaultRangeEndpointsCache key
omit_background

Render with a transparent background where the format supports alpha.

booleanfalse/v1/takeIn
format

Output format. Defaults to `jpg` on /take and `mp4` on /animate.

enumjpg/v1/take, /v1/animateIn
selector

Capture only the element matching this CSS selector.

string/v1/takeIn
image_quality

Encoder quality for lossy formats.

integer801 – 100/v1/take, /v1/animateIn
Group: ImageValues outside a documented range are rejected before a browser opens.

How it behaves next to the rest of the request

format

Output format. Defaults to `jpg` on /take and `mp4` on /animate.

Choose one with an alpha channel. This build's encoder support is measured at runtime and shown in the dashboard, because JP2 and HEVC-HEIF are not compiled into the libvips it links against.

selector

Capture only the element matching this CSS selector.

The pairing that matters: capture one element with no backdrop and you get an asset instead of a screenshot.

styles

CSS injected into the page.

When the page paints its own background, inject `background: transparent` for the elements you need cleared. Transparency then comes from the page rather than from the absence of a backdrop.

Errors this option can produce

None of them is billable. No error code in the catalog is.

Questions this raises

My capture is still white. What did I miss?

Almost always a background the page paints on `html` or `body`. Override it with `styles` — `omit_background` only removes the browser's default backdrop.

Which formats keep transparency?

PNG, WebP, AVIF and TIFF. JPEG has no alpha channel at all, and this build of libvips does not encode JP2 or HEVC-HEIF.

Does it work with full-page captures?

Yes, though it is rarely useful there: a full page usually paints its own background from edge to edge.