API Endpoint Access URL
https://api.pixlab.io/txtremove
Get Your API Key & Try TXT-REMOVE Watermark Remover ↗Description
The Text and Watermark remover API (TXT-REMOVE) lets developers remove visible text, captions, timestamps, labels, subtitles, and permitted watermarks from images with a single REST request. The endpoint detects text-like overlay regions, rebuilds the surrounding background, and returns a clean image for publishing workflows, moderation tools, product pipelines, or further AI processing.
The API combines OCR-style text region detection with image inpainting to remove unwanted words and text watermarks while preserving nearby texture, color, and layout. Use TXT-REMOVE to clean user-generated content, remove temporary annotations, prepare owned marketing assets, redact visible text in image pipelines, or automate large media cleanup queues without building your own detection and inpainting stack.
- Remove text and watermark overlays from images through a simple REST API for backend services, mobile apps, automation workers, and serverless jobs. No SDK required.
- Detects one or many text-like regions in the same image, including captions, labels, timestamps, and permitted watermark overlays
- Reconstructs the removed area with image inpainting instead of leaving a flat blur or solid box
- Returns JSON with BASE64 image data or an S3 output link when storage is connected
- Fits synchronous cleanup requests, moderation workflows, and parallel batch image processing jobs
A common use case is removing unwanted text from input images that you own or have rights to process (see notes below), allowing for cleaner product photos, UI screenshots, social media assets, real estate images, and publishing previews as demonstrated in the following example:
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.
Developers can integrate this text removal API with minimal setup. Send an image, receive a cleaned output image, and pass the result directly into publishing, UI, moderation, ecommerce, document cleanup, or additional AI workflows. For bulk jobs, the endpoint is easy to call in parallel from your own queue or worker system.
To begin integrating TXT-REMOVE into your codebase, get an API key from the PixLab Console ↗, call the endpoint with your image input, and parse the JSON response. The code samples section below ↓ includes ready-to-adapt examples in multiple programming languages.
If you need to remove full image backgrounds instead of text overlays, use the BG-REMOVE endpoint. Need to extract, read, or translate text inside an image rather than erase it? Use the Image Text Translation API for OCR and 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 remove text from images 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 and Watermark remover 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 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 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}")
// 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.
const apiKey = 'PIXLAB_API_KEY'; // PixLab API Key - Get yours from https://console.pixlab.io/
const apiUrl = 'https://api.pixlab.io/txtremove';
const imageFile = document.querySelector('input[type="file"]'); // Assuming you have an input file element
async function removeText() {
if (!imageFile || !imageFile.files || !imageFile.files[0]) {
console.error('Please select an image file.');
return;
}
const file = imageFile.files[0];
const formData = new FormData();
formData.append('file', file);
formData.append('key', apiKey);
try {
const response = await fetch(apiUrl, {
method: 'POST',
body: formData,
});
const reply = await response.json();
if (reply.status !== 200) {
console.error(reply.error);
} else {
const imgData = reply.imgData; // Base64 encoding of the output image
const mimetype = reply.mimeType; // MIME type (i.e image/jpeg, etc.) of the output image
const extension = reply.extension; // File extension (e.g., 'png', 'jpeg')
// Decode base64 and save to disk
try {
const img_bytes = atob(imgData); // Decode base64
const output_filename = `output_image.${extension}`;
// Create a Blob from the base64 string
const byteCharacters = atob(imgData);
const byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += 512) {
const slice = byteCharacters.slice(offset, offset + 512);
const byteNumbers = new Array(slice.length);
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
const blob = new Blob(byteArrays, {type: mimetype});
// Create a download link
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = output_filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url); // Clean up
console.log(`Text Removed Image saved to: ${output_filename}`);
} catch (e) {
console.error(`Error saving output image: ${e}`);
}
}
} catch (error) {
console.error('Error:', error);
}
}
// Example: Attach to a button click
const button = document.querySelector('#removeTextButton'); // Assuming you have a button with this ID
if (button) {
button.addEventListener('click', removeText);
}
<?php
# 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. If your image is publicly available
# then make a simple GET request with a link to your image.
$url = 'https://api.pixlab.io/txtremove';
$apiKey = 'PIXLAB_API_KEY'; // PixLab API Key - Get yours from https://console.pixlab.io/
$imagePath = './local_image.png'; // The local image we are going to remove text from
$outputFilename = 'output_image';
$ch = curl_init();
$postData = [
'key' => $apiKey,
'file' => new CURLFile(realpath($imagePath))
];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/form-data"));
$response = curl_exec($ch);
curl_close($ch);
$reply = json_decode($response, true);
if ($reply['status'] != 200) {
echo $reply['error'] . PHP_EOL;
} 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 {
$imgBytes = base64_decode($imgData);
$outputFilename = $outputFilename . "." . $extension;
file_put_contents($outputFilename, $imgBytes);
echo "Text Removed Image saved to: " . $outputFilename . PHP_EOL;
} catch (Exception $e) {
echo "Error saving output image: " . $e->getMessage() . PHP_EOL;
}
}
require 'net/http'
require 'json'
require 'base64'
require 'uri'
# Programmatically remove text from images and permitted watermarks using the 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.
uri = URI('https://api.pixlab.io/txtremove')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
form_data = {
'key' => 'PIXLAB_API_KEY', # PixLab API Key - Get yours from https://console.pixlab.io/
'file' => File.open('./local_image.png')
}
request.set_form(form_data, 'multipart/form-data')
response = http.request(request)
reply = JSON.parse(response.body)
if reply['status'] != 200
puts reply['error']
else
img_data = 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
begin
img_bytes = Base64.decode64(img_data)
output_filename = "output_image.#{extension}"
File.open(output_filename, "wb") do |f|
f.write(img_bytes)
end
puts "Text & Watermark Removed Image saved to: #{output_filename}"
rescue => e
puts "Error saving output image: #{e}"
end
end
Similar API Endpoints
tagimg, nsfw, describe, docscan, llm-parse, docscan, bg-remove, image-text-translate, facelookup ↗, faceverify ↗, img-embed, query