Free plan

Redact text in image

Hide private words and numbers in a picture with a box or blur
POST
/v1/images/redact-text

About this tool

The tool reads the words in a screenshot or a photo of a document (this is called OCR, a computer reading the letters in a picture). It then covers the words you list, or kinds of data such as e-mail addresses, phone numbers and card numbers, with a solid box, a blur or a pixelation. It works best on clear, sharp text, and you should check the result because reading can miss a word.
For example, you hide the e-mail address and phone number in a screenshot before you send it to a stranger.

How to use it

  1. Choose this tool.
  2. Add your screenshot or photo with Upload or drag and drop.
  3. Type the words to hide, or tick the kinds of data to hide.
  4. Choose how to cover them (box, blur or pixelate) and the language of the text.
  5. Press Generate, then download the picture.

What you get back

You get a new picture with the matching text covered. You can also choose to only get a list of what was found and where, with no picture.
GOOD TO KNOW
OCR can miss text (low contrast, small or curved letters), so check the result; a card number is only matched when it passes the Luhn check. The redacted picture is a PNG. Counts as one image per picture.
TEST IT LIVE

Try Redact text in image in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/redact-text
Tool ID
images.redact-text
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/redact-text" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'terms=["John Smith","Project Falcon"]' \
  -F 'kinds=["email","card"]' \
  -F 'mode=box'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.redactText({
    "images": 'photo.jpg',
    "terms": "[\"John Smith\",\"Project Falcon\"]",
    "kinds": "[\"email\",\"card\"]",
    "mode": "box"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->redactText([
    'images' => 'photo.jpg',
    'terms' => '["John Smith","Project Falcon"]',
    'kinds' => '["email","card"]',
    'mode' => 'box',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Find text in a screenshot or a photo of a document with OCR, match your words or kinds of data (e-mail, phone, card number, IBAN, …), and cover them with a box, a blur or a pixelation; or only list where they are.

Redact text in image accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Redact text in image is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/redact-text with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.