API Endpoint Access URL
https://api.pixlab.io/txtremove
Get an API Key and Test TXT-REMOVE ↗Automatic Text and Watermark Removal API
PixLab's Text and Watermark Removal API (TXT-REMOVE) is designed for high-volume image processing. Submit an image containing captions, labels, timestamps, subtitles, annotations, or permitted watermarks in one REST request. The endpoint locates text-like regions automatically and reconstructs the covered area, so your integration does not need masks, bounding boxes, coordinates, or a separate OCR pass. A successful request returns a cleaned image ready to be used in your app or displayed on your website or online store without further processing.
After detecting an overlay, TXT-REMOVE uses nearby colors, textures, gradients, and image structure to rebuild the cleared region. The result is a reconstructed image area rather than text hidden behind a blur or solid block.
Developers can call TXT-REMOVE from a backend service, worker, serverless function, or scheduled job. It fits products used by ecommerce businesses, marketing teams, publishers, online shops, and creative studios for catalog cleanup, campaign updates, localization, moderation, and media archive processing.
What TXT-REMOVE provides:
- A single REST endpoint that works with backend services, mobile applications, automation workers, and serverless jobs. No SDK is required.
- Automatic text-region detection without a client-generated mask or coordinate list.
- Detection of one or multiple captions, labels, timestamps, and permitted overlays in the same image.
- Context-aware reconstruction instead of a flat blur or solid rectangle.
- Output as Base64 image data in JSON, raw image bytes, or a link to a file in your connected AWS S3 bucket.
- Support for synchronous requests and high-volume jobs distributed through your own queues and workers.
- Access through the same monthly PixLab plan used for other media-processing endpoints.
High-volume and bulk text removal
TXT-REMOVE processes one image per request and is designed to run in parallel through queues, workers, serverless functions, or scheduled jobs within your account limits. This makes it suitable for bulk image processing, including catalog migrations, campaign refreshes, licensed media archives, recurring cleanup tasks, and applications that handle images continuously.
Common integration workflows
- Ecommerce catalogs: clear authorized price labels, campaign badges, captions, or temporary promotional text before reusing product images.
- Marketing and localization: remove existing copy from approved creative assets before adding translated or updated messaging.
- Screenshots and interface assets: clean labels, annotations, timestamps, and test content from images controlled by your organization.
- Publishing and media archives: process batches of licensed images containing obsolete captions or temporary overlays.
Output quality depends on the source image. Large or transparent overlays and text placed over faces, fine details, or dense patterns can be harder to reconstruct. Production workflows should review important assets before publishing the cleaned output.
The example below shows an authorized image before and after automatic text detection and background reconstruction:
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.
Private processing by default: PixLab processes submitted API images in volatile memory and purges them automatically when processing finishes. PixLab does not persist the payload unless you explicitly enable storage or export. With a connected AWS S3 bucket, output can be written directly to your own bucket. See the PixLab Privacy Policy for processing and retention details.
A typical integration submits an image, receives the cleaned output, and passes it to the next publishing, ecommerce, localization, moderation, or media-processing step. For larger jobs, your application can distribute requests through its existing queue or worker system.
To get started, create an API key in the PixLab Console ↗, submit 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 monthly API plans for developers and businesses processing authorized image collections at high volume. The included media-processing calls can be used with TXT-REMOVE and other PixLab endpoints, so one subscription can support several image workflows.
- Starter: $20 per month with 350,000 media-processing API calls, which can be used for up to 350,000 TXT-REMOVE requests when the quota is dedicated to this endpoint.
- Pro: $39 per month with 900,000 media-processing API calls, which can be used for up to 900,000 TXT-REMOVE requests when the quota is dedicated to this endpoint.
- Business and Enterprise: Higher monthly quotas, storage, support, and options for large production workloads.
Low cost per image: with one image per request and the full monthly allowance dedicated to TXT-REMOVE, Starter works out to approximately $0.00006 per included image, while Pro is approximately $0.00004 per included image. Your actual unit cost depends on plan usage.
Automated reconstruction can also reduce manual cleanup across catalogs, archives, and recurring content pipelines. Review the current PixLab monthly API plans → or start a 7-day trial ↗.
HTTP Methods
POST
Send a synchronous POST request to https://api.pixlab.io/txtremove. Use your own queue or worker pool to process larger image collections in parallel.
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. TXT-REMOVE detects text automatically, so no mask, text coordinates, or OCR response is required. 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}")
// 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
Frequently Asked Questions
Does the API automatically remove text from images without a mask?
Yes. Send the image in a multipart POST request and TXT-REMOVE automatically detects text-like regions before reconstructing the affected background. Your integration does not need to provide masks, bounding boxes, coordinates, or a separate OCR result.
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. TXT-REMOVE is built for high-volume image processing and bulk text-removal workflows. Send one image per request and distribute jobs across queues, workers, serverless functions, or scheduled pipelines, subject to account limits. This approach supports 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. When the quota is used only for TXT-REMOVE, with one image per request and full monthly usage, that is approximately $0.00006 per image. The $39 Pro plan includes 900,000 media-processing calls, or approximately $0.00004 per 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.
How does PixLab handle images uploaded to TXT-REMOVE?
By default, submitted API images are processed in volatile memory, automatically purged after processing, and not persisted by PixLab. If you explicitly enable storage or connect your own AWS S3 bucket, the output can be written to that configured destination. Review the Privacy Policy for details.
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.
Similar API Endpoints
tagimg, nsfw, describe, docscan, llm-parse, bg-remove, image-text-translate, facelookup ↗, faceverify ↗, img-embed, query