API for SVG Masks

How to receive Algorithm Masks visualized as SVG images.

the Masks are additional results of image analysis, representing the spatial information about detected skin/hair health returned by the selected set of Algorithms.

Check the Masks description for more details.

Apply Mask V5 Http

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
company_idstring · uuidRequired
Body
image_idstring · uuid4Required
image_typestring · enumRequiredPossible values:
mask_over_imagebooleanOptionalDefault: false
Responses
200

Successful Response

application/json
post
/service/rasterisation/v5/svg_masks/

Possible Results

Normal full result (masked image + metrics + submetrics)

Normal result without submetrics

Normal result but without mask

Possible Errors

If you accidentally request an algorithm without masks:

If you request an algorithm that wasn't calculated for the image:

Example SVG Mask

Hydration Mask

How to embed SVG mask or image to HTML

Without JavaScript

Using object tag, just insert the generated signed URL into data attribute.

✅ Pros: Retains SVG scalability and interactions.

❌ Cons: Limited browser support and no direct CSS styling.

With JavaScript

Download SVG content from the signed URL and inject it into your div container.

✅ Pros: Allows direct manipulation via CSS and JS.

❌ Cons: Requires JavaScript to fetch and insert the SVG.

CSS mask customization example

For example I have the svg mask for eye bags algorithm.

The mask consists of 3 masks actually:

  • eye_bags-dark_circles_mask (yellow)

  • eye_bags-eye_bags_mask (green)

  • eye_bags-lacrimal_grooves_mask (white)

And it will look like this:

For example, I would like to override the fill color of eye_bags-eye_bags_mask.

In order to achieve it, I need to add this CSS rule:

So the result would look like this:

Last updated

Was this helpful?