Image Invisible Picture Watermark
curl --request POST \
--url https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark \
--header 'Content-Type: multipart/form-data' \
--header 'ailabapi-api-key: <api-key>' \
--form 'function_type=<string>' \
--form origin_image='@example-file' \
--form logo='@example-file' \
--form 'output_file_type=<string>' \
--form watermark_image='@example-file' \
--form 'quality_factor=<string>'import requests
url = "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark"
files = {
"origin_image": ("example-file", open("example-file", "rb")),
"logo": ("example-file", open("example-file", "rb")),
"watermark_image": ("example-file", open("example-file", "rb"))
}
payload = {
"function_type": "<string>",
"output_file_type": "<string>",
"quality_factor": "<string>"
}
headers = {"ailabapi-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('function_type', '<string>');
form.append('origin_image', '<string>');
form.append('logo', '<string>');
form.append('output_file_type', '<string>');
form.append('watermark_image', '<string>');
form.append('quality_factor', '<string>');
const options = {method: 'POST', headers: {'ailabapi-api-key': '<api-key>'}};
options.body = form;
fetch('https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"ailabapi-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ailabapi-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark")
.header("ailabapi-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ailabapi-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"request_id": "",
"log_id": "",
"error_detail": {
"code": "",
"code_message": "",
"message": ""
},
"data": {
"watermark_image_url": "",
"logo_url": ""
}
}Image Invisible Picture Watermark
Image Invisible Picture Watermark API
Image Invisible Picture Watermark API encodes or decodes hidden image and logo watermarks for copyright and asset protection.
POST
/
api
/
image
/
editing
/
image-invisible-image-watermark
Image Invisible Picture Watermark
curl --request POST \
--url https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark \
--header 'Content-Type: multipart/form-data' \
--header 'ailabapi-api-key: <api-key>' \
--form 'function_type=<string>' \
--form origin_image='@example-file' \
--form logo='@example-file' \
--form 'output_file_type=<string>' \
--form watermark_image='@example-file' \
--form 'quality_factor=<string>'import requests
url = "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark"
files = {
"origin_image": ("example-file", open("example-file", "rb")),
"logo": ("example-file", open("example-file", "rb")),
"watermark_image": ("example-file", open("example-file", "rb"))
}
payload = {
"function_type": "<string>",
"output_file_type": "<string>",
"quality_factor": "<string>"
}
headers = {"ailabapi-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('function_type', '<string>');
form.append('origin_image', '<string>');
form.append('logo', '<string>');
form.append('output_file_type', '<string>');
form.append('watermark_image', '<string>');
form.append('quality_factor', '<string>');
const options = {method: 'POST', headers: {'ailabapi-api-key': '<api-key>'}};
options.body = form;
fetch('https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"ailabapi-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ailabapi-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark")
.header("ailabapi-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ailabapi-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"function_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"origin_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_file_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"watermark_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality_factor\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"request_id": "",
"log_id": "",
"error_detail": {
"code": "",
"code_message": "",
"message": ""
},
"data": {
"watermark_image_url": "",
"logo_url": ""
}
}Request
- URL:
https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
JPEGJPGPNGBMP - Image size: No more than 3 MB.
- Image resolution: Larger than 5x5px, smaller than 4096x4096px.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
Fixed Fields
| Field | Required | Type | Scope | Description |
|---|---|---|---|---|
function_type | YES | string | encode_pic, encode_pic_plus, encode_pic_bold, decode_pic, decode_pic_plus, decode_pic_bold | Specifies the calling function. encode_pic`: Add image watermark using the old model.` encode_pic_plus: Add image watermark with new version model 1. encode_pic_bold`: Add image watermark with new version model 2.` decode_pic: Use the old model to decode the image watermark in the image. decode_pic_plus`: Use the new version Model 1 to decode the image watermark in the image.` decode_pic_bold: Use the new version Model 2 to decode the image watermark in the image. |
function_type === encode_pic|encode_pic_plus|encode_pic_bold
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
origin_image | YES | file | Original image. | ||
logo | YES | file | Watermark images. | ||
output_file_type | NO | string | jpeg, png, jpg, bmp | png | Output format. |
function_type === decode_pic
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
watermark_image | YES | file | The image to be resolved, i.e. the composite image with the image watermark. | ||
origin_image | YES | file | Original image. |
function_type === decode_pic_plus|decode_pic_bold
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
watermark_image | YES | file | The image to be resolved, i.e. the composite image with the image watermark. |
output_file_type === jpg
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
quality_factor | NO | integer | [1, 100] | 100 | The quality size of the output image, the higher the quality the larger the image. |
Response
Response Field Handling Flow
-
Handle
Public Response FieldsParse and validate thePublic Response Fields, checking the status code or response message to ensure the request is successful and error-free. -
Handle
Business Response FieldsIf thePublic Response Fieldsare valid and error-free, proceed with processing the business logic in theBusiness Response Fields.
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Description |
|---|---|---|
data | object | The content of the result data returned. |
+watermark_image_url | string | The URL address after adding the watermark. |
+logo_url | string | Watermark URL address after decoding. |
All result URLs are temporarily available and will expire after 24 hours.
Response Example
{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"data": {
"watermark_image_url": "",
"logo_url": ""
}
}
Authorizations
API Key for authentication
Body
multipart/form-data
Specifies the calling function.
Original image.
Watermark images.
Output format.
The image to be resolved, i.e. the composite image with the image watermark.
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.
⌘I

