Skip to content
Menu
Auto
English
v1 is in long-term maintenance and continues to receive compatibility, security, and critical bug fixes. See the v2.

Choose an API

The three public methods share the same output options. Choose by layer type:

Method Use it for Layer order
Marker.markText One or many text watermarks Text array order
Marker.markImage One or many image watermarks Image array order
Marker.mark Text and image watermarks together Exact watermarks array order
Marker.createRecipe Reuse ordered layers across one or many images Exact watermarks array order

markText and markImage remain supported. Use mark when a single render needs both text and image layers or when cross-type ordering matters.

import Marker, { ImageFormat, Position } from 'react-native-image-marker';
const result = await Marker.markText({
backgroundImage: { src: require('./background.jpg') },
watermarkTexts: [
{
text: 'PRIVATE',
position: { position: Position.center },
style: {
color: '#FFFFFF99',
fontSize: 42,
bold: true,
rotate: -18,
},
},
],
saveFormat: ImageFormat.png,
});

Use createRecipe when the watermark structure stays the same while the background or displayed values change. A Recipe accepts only the modern ordered watermarks array; pass backgroundImage, filename, and optional variables to apply() or applyMany() for each input. Text templates can read {{variableName}}, {{index}}, and {{filename}}; visibleWhen conditionally includes a layer.

applyMany() reports every item independently and preserves input order. Its default concurrency is 1. Web accepts up to 4 active jobs; iOS and Android stay at 1 to limit native memory pressure. An AbortSignal stops new work from being dispatched without claiming to interrupt a render already in progress.

Set schemaVersion: 1 when a Recipe will be serialized, and persist recipe.toJSON() rather than internal runtime state.

Layers render in array order. A later layer is drawn over an earlier one. This is especially important with Marker.mark, where text and image layers share the same array.

Prefer the plural arrays and current position property:

Avoid in new code Use instead
positionOptions on text position
watermarkImage watermarkImages
watermarkPositions position on each image layer
Separate calls for mixed content One Marker.mark call