Watermark
io_id
(required) specifies which input image to use as a watermark.gravity
determines how the image is placed within thefit_box
.{x: 0, y: 0}
represents top-left,{x: 50, y: 50}
represents center,{x:100, y:100}
represents bottom-right. Default:center
fit_mode
is one ofdistort
,within
,fit
,within_crop
, orfit_crop
. Meanings are the same as for constraint modes. Default:within
fit_box
can be eitherimage_percentage
(a box represented by percentages of target image width/height) orimage_margins
(a box represented by pixels from the edge of the image). Defaultimage_margins
0min_canvas_width
sets a minimum canvas width below which the watermark will be hidden.min_canvas_height
sets a minimum canvas height below which the watermark will be hidden.opacity
(0..1) How opaque to draw the image. Default 1.0hints
See resampling hints
Example with fit_box: image_percentage
This will align the watermark to 10% from the bottom and right edges of the image, scaling the watermark down if it takes more than 80% of the image space, drawing it at 80% opacity and applying 15% sharpening. It will not display on images smaller than 50x50px in either dimension.
{
"watermark": {
"io_id": 1,
"gravity": {
"percentage" : {
"x": 100,
"y": 100
}
},
"fit_mode": "within",
"fit_box": {
"image_percentage": {
"x1": 10,
"y1": 10,
"x2": 90,
"y2": 90
}
},
"min_canvas_width": 50,
"min_canvas_height": 50,
"opacity": 0.8,
"hints": {
"sharpen_percent": 15
}
}
}
Example with fit_box: image_margins
This will stretch/distort the watermark to fill the image except for a 5px margin.
{
"watermark": {
"io_id": 1,
"gravity": { "center": null },
"fit_mode": "distort",
"fit_box": {
"image_margins": {
"left": 5,
"top": 5,
"right": 5,
"bottom": 5
}
}
}
}