Skip to main content
POST
/
api
/
image
/
editing
/
image-invisible-text-watermarking
Image Invisible Text Watermark
curl --request POST \
  --url https://www.ailabapi.com/api/image/editing/image-invisible-text-watermarking \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form 'function_type=<string>' \
  --form 'text=<string>' \
  --form 'output_file_type=<string>' \
  --form 'quality_factor=<string>' \
  --form origin_image=@example-file \
  --form watermark_image=@example-file
{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"data": {
"watermark_image_url": "",
"text_image_url": ""
}
}

Request

  • URL: https://www.ailabapi.com/api/image/editing/image-invisible-text-watermarking
  • Method: POST
  • Content-Type: multipart/form-data

Image requirements

  • Image format: JPEG JPG PNG BMP
  • Image size: No more than 3 MB.
  • Image resolution: Larger than 5x5px, smaller than 4096x4096px.

Headers

FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Body

Fixed Fields

FieldRequiredTypeScopeDescription
function_typeYESstringencode_text, encode_text_plus, encode_text_bold, decode_text, decode_text_plus, decode_text_boldSpecifies the calling function. encode_text`: Add text watermark using the old version model.` encode_text_plus: Add text watermark using the new version model 1. encode_text_bold`: Add text watermark using the new version model 2.` decode_text: Use the old model to decode the text watermark in the image. decode_text_plus`: Use the new version of Model 1 to decode text watermarks in images.` decode_text_bold: Use the new version Model 2 to decode the image watermark in the image.

function_type === encode_text|encode_text_plus|encode_text_bold

FieldRequiredTypeScopeDefaultDescription
origin_imageYESfileOriginal image.
textYESstringThe text of the watermark to be added.
output_file_typeNOstringpng, jpg, bmppngOutput format.

function_type === decode_text

FieldRequiredTypeScopeDefaultDescription
watermark_imageYESfileThe image to be resolved, i.e., a composite image with a text watermark.
origin_imageYESfileOriginal image.

function_type === decode_text_plus|decode_text_bold

FieldRequiredTypeScopeDefaultDescription
watermark_imageYESfileThe image to be resolved, i.e., a composite image with a text watermark.

output_file_type === jpg

FieldRequiredTypeScopeDefaultDescription
quality_factorNOinteger[1, 100]100The quality size of the output image, the higher the quality the larger the image.

Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

FieldTypeDescription
dataobjectThe content of the result data returned.
+watermark_image_urlstringThe URL address after adding the watermark.
+text_image_urlstringWatermark URL address after decoding.
The URL address is a temporary address, valid for 24 hours, and will not be accessible after it expires. If you need to save the file for a long time or permanently, please visit the URL address within 24 hours and download the file to your own storage space.

Response Example

{
  "request_id":     "",
  "log_id":         "",
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "data":           {
    "watermark_image_url": "",
    "text_image_url":      ""
  }
}

Sample Code

[👉 Online Experience 👈(https://www.ailabtools.com/image-invisible-text-watermark-example)]If you’d like to see the actual effects, please visit the experience page for a trial.

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
function_type
string

Specifies the calling function.

origin_image
file

Original image.

text
string

The text of the watermark to be added.

output_file_type
string

Output format.

watermark_image
file

The image to be resolved, i.e., a composite image with a text watermark.

quality_factor
string

The quality size of the output image, the higher the quality the larger the image.

Response

200 - application/json

Success

The response is of type object.