Cloudflare Images segment=foreground vs Sume RMBG PNG alpha

Cloudflare Images removes a background with segment=foreground, but its listed output formats lack PNG. Sume RMBG returns PNG artifacts with alpha.

5 min readSume
All posts

Cloudflare Images can cut out a subject with the segment=foreground option in a transform URL, and the format list on its page names avif, webp and jpeg but not PNG. Sume's RMBG 1.0 returns mirrored PNG artifacts with alpha, so the file you get is a PNG by design.

Cloudflare's side is from its Transform via URL page and Sume's from the Sume OpenAPI schema, both read on 2026-10-03.

What does segment=foreground do?

The page describes segment as automatically isolating the subject of an image by replacing the background with transparent pixels, and it accepts the value foreground. It says the feature uses an open-source BiRefNet model through Workers AI.

It sits among the other URL options: seven fit modes (scale-down is the default), width in pixels or auto, and height in pixels. The page documents no maximum file size, megapixel limit or input dimension for transforms.

Cloudflare Images output formats listed (read 2026-10-03)
Format valueListed on the page
autoYes, the default for hosted images
avifYes
webpYes
jpeg / baseline-jpegYes
pngNot listed

Why does the missing PNG matter?

A cutout is only useful if the transparency survives. JPEG cannot hold an alpha channel, so a segment=foreground result needs avif or webp. Most browsers handle webp, but plenty of design tools, marketplaces and print workflows still ask for PNG, and the page does not offer a PNG route.

If your destination needs PNG, you either convert after the fact, which Cloudflare's page does not cover, or you use a service that returns PNG directly.

What does Sume RMBG return?

POST /v1/rmbg-1.0/remove takes a public HTTPS image_url and returns a job. Completed results expose mirrored PNG artifacts with alpha, hosted on media.sume.com. You do not choose a format, and there is no webp option on this route.

Cloudflare is a URL transform, so the result comes back in the same request. Sume is a job: mode: sync waits up to 30 seconds, and if the job is not done you poll status_url and fetch the result when result_ready is true. That is slower to wire up but gives you a durable URL, as the jobs and results page explains.

curl -X POST https://api.sume.com/v1/rmbg-1.0/remove \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/inputs/mug.jpg",
    "mode": "sync",
    "wait_timeout_seconds": 30
  }'

What should you test on a cutout before shipping?

Place the result on three backdrops: white, black and a saturated colour. Halos around hair or glass show on one of them. If your page uses a dark theme, black matters most.

Check file size too. A PNG with alpha is usually heavier than a webp of the same cutout. Where page weight matters, convert the Sume PNG to webp in your own pipeline after you have confirmed the edges; Sume's RMBG route itself has no format option.

Which one fits your pipeline?

If you serve images through Cloudflare and want a cutout on the fly in a browser-friendly format, segment=foreground is one parameter. If you need a transparent PNG to hand to a designer, a marketplace or a later Sume step, RMBG gives you that file directly. Whichever you pick, open the result on a dark and a light background before you ship, because edge halos only show up on a contrasting backdrop.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume