Skip to content
Get started

Preview

client.projects.watermark.preview(stringprojectID, WatermarkPreviewParams { opacity, placement, rotation, 3 more } body, RequestOptionsoptions?): WatermarkPreviewResponse { image }
POST/projects/{projectId}/watermark/preview

Draw the given watermark settings on a sample image, without saving them

ParametersExpand Collapse
projectID: string
body: WatermarkPreviewParams { opacity, placement, rotation, 3 more }
opacity?: number

Mark opacity, 0.05 (barely visible) to 1 (opaque)

maximum1
minimum0.05
placement?: "bottom-left" | "bottom-right" | "center" | 3 more

Where the mark sits on the image

One of the following:
"bottom-left"
"bottom-right"
"center"
"tiled"
"top-left"
"top-right"
rotation?: number

Mark rotation in degrees. 0 is horizontal, negative tilts it up.

maximum90
minimum-90
scale?: number

Mark width as a fraction of the image width

maximum1
minimum0.05
spacing?: number

Gap between repetitions, as a fraction of the mark’s own size. Only drawn for the tiled placement; 0 repeats the mark edge to edge.

maximum2
minimum0
text?: string

Text to draw. Optional only because a logo can stand in for it.

maxLength64
minLength1
ReturnsExpand Collapse
WatermarkPreviewResponse { image }

Response of the watermark preview routes.

image: string

The sample image with the mark drawn on it, base64-encoded.

Preview

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.projects.watermark.preview('projectId');

console.log(response.image);
{
  "image": "image"
}
Returns Examples
{
  "image": "image"
}