Text and Watermark Removal API for Images at Scale

Version 2.197 (Release Notes ↗)

Description

The PixLab Text and Watermark Removal API (TXT-REMOVE) removes captions, labels, timestamps, subtitles, annotations, and permitted watermarks from images with one REST request. It automatically detects text-like regions and reconstructs the affected area for publishing, product, moderation, and media-processing workflows.

TXT-REMOVE combines text-region detection with context-aware image inpainting. Instead of hiding an overlay with a blur or solid rectangle, the endpoint rebuilds nearby colors, textures, gradients, and visual structure to produce a more natural cleaned image.

PixLab is built for teams that need accurate image reconstruction and low unit cost across large image volumes. Use it to clean authorized product photos, UI screenshots, owned marketing assets, real estate images, temporary annotations, and user-generated content without maintaining a separate detection and inpainting stack.

Why developers use TXT-REMOVE:
  • Call a single REST endpoint from backend services, mobile apps, automation workers, or serverless jobs. No SDK is required.
  • Detect one or multiple text-like regions in the same image, including captions, labels, timestamps, and permitted overlays.
  • Reconstruct removed regions with inpainting instead of leaving a flat blur or solid box.
  • Receive Base64 image data in JSON, raw image bytes, or a link to output stored in your connected AWS S3 bucket.
  • Run synchronous requests or distribute bulk image cleanup across your own queues and workers.
  • Use one monthly PixLab plan across text removal and other media-processing endpoints.

The example below shows authorized text-overlay removal from an image before and after automatic region detection and reconstruction:

Input Image With Text Overlay (courtesy of FACEIO ↗)
Input image before text and watermark removal with TXT-REMOVE API
Clean Image After Text Removal
Clean output image after removing text and permitted watermark overlays

Lawful-use requirement: You may only process images that you own or are authorized to modify. You must not remove copyright notices, branding, stock-photo watermarks, or other ownership marks from third-party content without permission. Unauthorized use violates the PixLab Terms of Service and may result in account suspension or termination. The account holder is responsible for complying with copyright law and applicable licenses.

For production use, submit an image, receive the cleaned output, and pass it directly into publishing, e-commerce, moderation, document cleanup, or additional media workflows. Large jobs can be processed in parallel through your existing queue or worker system.

To integrate TXT-REMOVE, create an API key in the PixLab Console ↗, upload an image, and consume the returned image data. See the Python, JavaScript, PHP, and Ruby samples below ↓.

To remove a complete image background instead of a text overlay, use the BG-REMOVE API. To detect and translate text without erasing it, see the Image Text Translation API.

High-Volume Text and Watermark Removal API Pricing

PixLab offers predictable monthly paid plans for developers and businesses processing authorized image collections at scale. One subscription covers TXT-REMOVE and other PixLab media-processing endpoints, reducing the need for separate per-tool billing.

  • Starter: $20 per month with 350,000 included media-processing API calls.
  • Pro: $39 per month with 900,000 included media-processing API calls.
  • Business and Enterprise: Higher monthly quotas, storage, support, and options for large production workloads.

Low cost per image: when one image is processed per request and the full monthly quota is used, Starter works out to approximately $0.00006 per included image, while Pro is approximately $0.00004 per included image. Actual unit cost depends on plan usage and the number of images handled by each request.

Accurate region reconstruction can also reduce manual retouching across catalogs, archives, and recurring content-cleanup pipelines. Review the current PixLab monthly API plans → or start a 7-day trial ↗.

HTTP Methods

POST

HTTP Parameters

Required

Fields Type Description
key String Your PixLab API key ↗. You may send the key in the WWW-Authenticate HTTP header instead of this parameter.

Optional

Fields Type Description
blob Boolean By default, TXT-REMOVE returns a JSON object containing the Base64-encoded output image or a link to the result in your connected AWS S3 bucket. Set this parameter to true to return the raw image bytes instead. See HTTP Response ↓ and the code samples for details.

POST Request Body

TXT-REMOVE accepts image uploads through POST.

Supported content type:

  • multipart/form-data

Send a multipart/form-data request with the local image file. See the code samples below ↓ for working upload examples.

HTTP Response

application/json

By default, TXT-REMOVE returns a JSON object containing the Base64-encoded output image. If your AWS S3 bucket is connected through the PixLab Console ↗, the response can provide a direct link to the result in your bucket instead. When blob=true, the endpoint returns the raw image bytes rather than JSON.

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 of the output image, such as image/png.
extension String File extension of the output image, such as png or jpeg.
link URL Direct link to the output image in your own AWS S3 bucket, when S3 storage is connected through the PixLab Console ↗. This field is returned instead of imgData.
error String Error description when status != 200.
blob BLOB Raw image data returned instead of a JSON object when the blob parameter is set to true.

Code Samples


import requests
import json
import base64
import os

# Programmatically remove text from images and permitted watermarks 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 and permitted watermarks 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}")

Frequently Asked Questions

What can the PixLab Text and Watermark Removal API erase?

TXT-REMOVE detects text-like overlays such as captions, labels, timestamps, subtitles, annotations, and permitted watermarks. It then reconstructs the affected image regions with context-aware inpainting.

Can TXT-REMOVE process images in bulk?

Yes. Developers can run TXT-REMOVE from queues, workers, serverless jobs, and other parallel processing systems for large image collections and recurring production workflows.

How much does the Text and Watermark Removal API cost per image?

Monthly paid plans start at $20 for 350,000 included media-processing API calls. With one image per request and full monthly quota usage, that is approximately $0.00006 per included image. The $39 Pro plan includes 900,000 calls, or approximately $0.00004 per included image under the same assumptions. See current PixLab API pricing →.

How does TXT-REMOVE preserve the area behind removed text?

The endpoint combines text-region detection with image inpainting to reconstruct nearby color, texture, gradients, and visual structure instead of covering removed text with a blur or solid box.

Can I remove any watermark with the API?

No. TXT-REMOVE is only for images you own or are authorized to modify. Removing copyright notices, branding, or watermarks from third-party content without permission violates the PixLab Terms of Service.

← Return to API Endpoint Listing