path |
String |
'watermark.png' |
Path contains images used as a watermark, can use base64 image. |
text |
String |
'' |
Text used as a watermark. |
textWidth |
Number |
130 |
Text width of frame surrounds, units: px. |
textSize |
Number |
12 |
Font size of text, units: px. |
textColor |
String |
'white' |
Text color, you can use HEX or RGBA color codes. |
textBg |
String |
'rgba(0, 0, 0, 0.4)' |
Background color, you can use HEX or RGBA color codes. |
gravity |
String |
'se' |
The position of the watermark on the image (nw, n, ne, w, e, sw, s, se). |
opacity |
Number |
0.7 |
The transparency of watermark, the value between 0 and 1. |
margin |
Number |
10 |
Distance from watermark to edge of image. |
outputWidth |
Number |
'auto' |
Image width after adding watermark, units: px or use 'auto'. |
outputHeight |
Number |
'auto' |
Image height after adding watermark, units: px or use 'auto'. |
outputType |
String |
'jpeg' |
Image format after adding watermark, You can use one of three types (jpeg, png, webp). |
done |
Function |
function(imgURL){this.src=imgURL;} |
Called after image with watermark is created. |
fail |
Function |
function(){} |
Called after an error of images is occurring. |
always |
Function |
function(){} |
Called when processing finishes (done and fail). |