Skip to main content

AILabTools API - Image Invisible Picture Watermark - API

Request

  • URL: https://www.ailabapi.com/api/image/editing/image-invisible-image-watermark
  • 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.
FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY.

Body

Fixed Fields

FieldRequiredTypeScopeDescription
function_typeYESstring
  • 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

    FieldRequiredTypeScopeDefaultsDescription
    origin_imageYESfileOriginal image.
    logoYESfileWatermark images.
    output_file_typeNOstring
  • jpeg
  • png
  • jpg
  • bmp
  • pngOutput format.

    function_type === decode_pic

    FieldRequiredTypeScopeDefaultsDescription
    watermark_imageYESfileThe image to be resolved, i.e. the composite image with the image watermark.
    origin_imageYESfileOriginal image.

    function_type === decode_pic_plus|decode_pic_bold

    FieldRequiredTypeScopeDefaultsDescription
    watermark_imageYESfileThe image to be resolved, i.e. the composite image with the image watermark.

    output_file_type === jpg

    FieldRequiredTypeScopeDefaultsDescription
    quality_factorNOInteger[1, 100]100The quality size of the output image, the higher the quality the larger the image.

    Response

    Public Parameters

    Viewing Public Parameters and Error Codes

    Business Parameters

    FieldTypeDescription
    dataobjectThe content of the result data returned.
    +watermark_image_urlstringThe URL address after adding the watermark.
    +logo_urlstringWatermark URL address after decoding.
    tip

    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.

    Example

    {
    "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": "",
    "logo_url": ""
    }
    }

    Code example

    If you'd like to see the actual effects, please visit the experience page for a trial.