Eraser
Changed onTry out this capability in Bria's sandbox
Description
The Eraser Route enables the removal of elements or specific areas from a given image.
You can define the area to be removed by providing a mask that outlines the region to be erased. There are two main ways recommended to generate these masks:
-
Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following <a href="https://github.com/Bria-AI/js-api-sdk/blob/main/manual_brush_ui" target="_blank">link</a>.
-
By using the /image/segment/all_masks route, which returns every region the model can identify as an individual mask. The older /objects/mask_generator route returns the same masks as a single ZIP archive and is deprecated.
Erase Modes
The composite parameter picks one of two modes. Pixel perfect (true, the default) rebuilds only the masked area and blends it into the original, so everything outside the mask stays as it was. Context aware (false) also removes what the object casts outside the mask, such as its shadow or its reflection, so the edit can't be spotted.
Output Characteristics
- The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling.
- With composite set to true, everything outside the mask stays as it was.
Request
- Base URL: https://engine.prod.bria-api.com/v2/image/edit
- URL: https://engine.prod.bria-api.com/v2/image/edit/erase
- Auth: API key in header api_token
Request body
Response
Successful operation (Synchronous Success)
Changes
- info
added the new optional request property
- info
- warning
deleted the
headerrequest parameterapi_token - info
api tag
Editingadded - info
api tag
v2 endpointsremoved
- warning