Text & Watermark Removal API Endpoint

Version 2.197 (Release Notes ↗)

Description

The Text & Watermark Removal API (TXT-REMOVE) empowers developers to automatically detect and remove unwanted text or watermark overlays from images and video frames using a single, high-performance API call. Whether you're cleaning up images for UI, content automation, or batch media processing, this endpoint fits naturally into your workflow.

Backed by PixLab's Vision Language Models APIs, the endpoint intelligently separates embedded text or watermark layers from genuine background content, all without degrading image quality. It supports varying image resolutions and multiple text regions, making it an ideal choice for marketing teams, content platforms, creative tools, and developers managing large media pipelines.

Note: This API is intended for lawful use only. You must not use it to remove watermarks, copyright notices, or branding from content that you do not own or have rights to. This includes logos, stock photo watermarks, or third-party material. Doing so violates our Terms of Service, and will result in immediate account suspension or permanent restriction. As the account holder, you are solely responsible for ensuring your use complies with copyright laws and our developer terms.

Key Features:
  • Seamless API integration across platforms; just plug in and go
  • Works with single or multiple regions in high-res images
  • Fast processing ideal for both real-time and batch workloads
  • Output is clean, sharp, and ready to use

Developers can integrate this endpoint with minimal setup. You'll receive a clean, watermark-free image as output, suitable for immediate downstream use (e.g., publishing, UI, or further AI processing). For bulk jobs, this endpoint is highly parallelizable.

To begin integrating TXT-REMOVE into your codebase, please visit the PixLab Console ↗ and invoke the TXT-REMOVE endpoint. For implementation guidance, refer to the Code Samples section below ↓ which provides readily available code examples in various programming languages to facilitate rapid integration.

If you're looking to remove full backgrounds from images instead, refer to the BG-REMOVE endpoint. Need to extract or translate text inside an image? Check out the Image Text Translation API for OCR + multilingual support.

HTTP Methods

POST

HTTP Parameters

Required

Fields Type Description
key String Your PixLab API Key ↗. You can also embed your key in the WWW-Authenticate: HTTP header and omit this parameter if you want to.

Optional

Fields Type Description
blob Boolean By default, the Text and Watermark removal API endpoint always returns a JSON Object (see Response Details ↓) containing the BASE64 encoded image output or a direct link to the output image stored in your private AWS S3 bucket if you've already connected your S3 storage credentials from the PixLab Console ↗. However, if this parameter is set to true, the raw image binary content is returned instead (see the Code Sample section for implementation details).

POST Request Body

This section details the requirements for using a POST request instead of a simple GET request.

Allowed Content-Types:

  • multipart/form-data

Submit a multipart/form-data POST request to directly upload your image from your app. Refer to the code samples section below ↓ on how to do so.

HTTP Response

application/json

By default, the Text & Watermark removal API endpoint always returns a JSON Object containing the BASE64 encoded image output or a direct link to the output image stored in your private AWS S3 bucket if you've already connected your S3 storage credentials from the PixLab Console ↗. if one the other side, the blob parameter (documented above) is set to true, the raw image binary content is returned instead.

Fields Type Description
status Integer HTTP 200 indicates success. Any other code indicates failure.
imgData Base64 Data Base64 encoded string of the output image data.
mimeType String Mime type such as image/png of the output image.
extension String Extension such as jpeg of the output image.
link URL Optionally, a direct link to the output image (instead of the imgData field) stored on your own AWS S3 bucket if you already connected your AWS S3 credentials from the PixLab Console ↗.
error String Error description when status != 200.
blob BLOB Optionally, the image blob data is returned instead of this JSON object if the blob parameter (documented above) is set to true.

Code Samples


import requests
import json
import base64
import os

# Programmatically remove text & watermarks from input images using the PixLab TXT-REMOVE API endpoint.
#
# Refer to the official documentation at: https://pixlab.io/endpoints/text-watermark-remove-api for the API reference
# guide and more code samples.

# Use POST to upload the image directly from your local folder
req = requests.post(
    'https://api.pixlab.io/txtremove',
    files={
        'file': open('./local_image.png', 'rb')  # The local image we are going to remove text & watermark from
    },
    data={
        'key': 'PIXLAB_API_KEY'  # PixLab API Key - Get yours from https://console.pixlab.io/
    }
)
reply = req.json()
if reply['status'] != 200:
    print(reply['error'])
else:
    imgData = reply['imgData']  # Base64 encoding of the output image
    mimetype = reply['mimeType']  # MIME type (i.e image/jpeg, etc.) of the output image
    extension = reply['extension']  # File extension (e.g., 'png', 'jpeg')

    # Decode base64 and save to disk
    try:
        img_bytes = base64.b64decode(imgData)
        output_filename = f"output_image.{extension}"
        with open(output_filename, "wb") as f:
            f.write(img_bytes)
        print(f"Text Removed Image saved to: {output_filename}")
    except Exception as e:
        print(f"Error saving output image: {e}")
← Return to API Endpoint Listing