cloak.business — Image Anonymization
Last Updated: 2026-02-12 Image Redactor Version: 5.3.0 Platform Version: 6.9.1
Table of Contents#
- Overview
- Supported Image Formats
- How It Works
- OCR Language Support
- Detection Capabilities
- Redaction Options
- Web App Usage
- Desktop App Usage
- API Reference
- API Key Authentication (MCP / Programmatic)
- Token Cost
- Plan Availability
- Known Limitations
- FAQ
- Troubleshooting
Overview#
cloak.business can detect and redact personally identifiable information (PII) directly from images. The service uses Optical Character Recognition (OCR) to extract text from images, then applies the same 317 pattern-based recognizers used for text anonymization to identify PII. Detected entities are redacted with colored rectangles on the image itself.
Key capabilities:
- Detect PII in scanned documents, screenshots, photos of forms, ID cards, and more
- 37 OCR languages for text extraction
- 317 pattern-based recognizers (phone numbers, IDs, credit cards, etc.)
- 390+ entity types across 75+ countries
- Automatic EXIF orientation correction for phone photos
- Bounding box padding and merging for clean redaction
- Configurable redaction fill colors
Supported Image Formats#
| Format | Extensions | Notes |
|---|---|---|
| PNG | .png | Recommended for screenshots and digital documents |
| JPEG | .jpg, .jpeg | Photos, scanned documents |
| BMP | .bmp | Uncompressed bitmap |
| TIFF | .tiff, .tif | Multi-page not supported (first page only) |
Size Limits#
| Limit | Value | Configurable |
|---|---|---|
| Maximum file size | 10 MB (absolute ceiling) | Plan-based (may be lower) |
| Maximum resolution | 150 megapixels | MAX_IMAGE_PIXELS env var |
| OCR downscale threshold | 4096 px (longest side) | MAX_IMAGE_DIMENSION env var |
| Bounding box padding | 4 px | BBOX_PADDING env var |
Automatic downscaling: Images with either dimension exceeding 4096 pixels are automatically downscaled using LANCZOS resampling before OCR processing. Bounding box coordinates are mapped back to original image dimensions, so redaction overlays align correctly with the full-resolution image. This improves both speed and memory usage:
| Original Size | Downscaled To | OCR Time | Memory |
|---|---|---|---|
| 1341 x 596 (< 4096) | No downscaling | ~0.8s | Low |
| 5972 x 2653 | 4096 x 1819 | ~4.1s | Low |
| 10327 x 4589 | 4096 x 1820 | ~3.7s | Low |
| > 150 megapixels | Rejected (HTTP 413) | — | — |
Not supported: GIF, SVG, WebP, HEIC/HEIF, PDF (use text anonymization for PDFs).
How It Works#
Image anonymization follows a multi-step pipeline:
1. Image Preparation#
- EXIF orientation is automatically applied. Photos taken with a rotated phone camera are corrected before processing, ensuring bounding boxes align correctly.
- Color mode conversion: RGBA, palette (P), and other modes are converted to RGB for consistent OCR processing. Transparency is composited onto a white background.
2. Text Extraction (OCR)#
- Tesseract OCR extracts text and character positions from the image.
- A language hint is sent based on your selected detection preset, improving OCR accuracy for non-English text (e.g., selecting a German preset tells Tesseract to use the German language model).
- OCR produces per-word bounding boxes with text content.
3. PII Detection#
- Extracted text is analyzed by the Presidio Analyzer engine.
- 317 pattern-based recognizers detect structured PII (phone numbers, credit cards, IDs, postal codes, etc.) across 75+ countries regardless of language.
- English NER model (spaCy) detects names, locations, and organizations.
- Each detected entity is mapped back to its bounding box coordinates in the image.
4. Bounding Box Refinement#
- Padding (4 pixels default) is added around each detection box to ensure text is fully covered.
- Adjacent box merging combines per-word boxes for multi-word entities (e.g., "John Doe" becomes one redaction rectangle instead of two).
- Merge criteria: same entity type, vertical overlap, horizontal gap ≤ 8 pixels.
5. Redaction#
- Filled rectangles are drawn over each detection area on a copy of the original image.
- The original image is never modified.
- The output format matches the input format (PNG in → PNG out).
OCR Language Support#
Tesseract OCR language packs are installed for 37 languages. The language is selected automatically based on your detection preset.
Languages with OCR Support (37)#
| Language | Code | Tesseract Pack |
|---|---|---|
| Afrikaans | af | afr |
| Arabic | ar | ara |
| Bulgarian | bg | bul |
| Catalan | ca | cat |
| Czech | cs | ces |
| Danish | da | dan |
| German | de | deu |
| Greek | el | ell |
| English | en | eng |
| Spanish | es | spa |
| Persian | fa | fas |
| Finnish | fi | fin |
| French | fr | fra |
| Hebrew | he | heb |
| Hindi | hi | hin |
| Croatian | hr | hrv |
| Hungarian | hu | hun |
| Indonesian | id | ind |
| Italian | it | ita |
| Japanese | ja | jpn |
| Korean | ko | kor |
| Lithuanian | lt | lit |
| Macedonian | mk | mkd |
| Dutch | nl | nld |
| Norwegian | nb | nor |
| Polish | pl | pol |
| Portuguese | pt | por |
| Romanian | ro | ron |
| Russian | ru | rus |
| Slovenian | sl | slv |
| Swedish | sv | swe |
| Thai | th | tha |
| Turkish | tr | tur |
| Ukrainian | uk | ukr |
| Vietnamese | vi | vie |
| Chinese (Simplified) | zh | chi_sim |
Languages without OCR Pack (fallback to English OCR)#
These languages use the English OCR model. Pattern-based entity detection (phone numbers, IDs, etc.) still works, but name recognition may be less accurate.
Slovak (sk), Serbian (sr), Latvian (lv), Estonian (et), Malay (ms), Bengali (bn), Urdu (ur), Swahili (sw), Tagalog (tl), Icelandic (is), Armenian (hy), Basque (eu)
Detection Capabilities#
Image PII detection uses the same recognizer engine as text anonymization:
- 317 pattern-based recognizers — Phone numbers, national IDs, tax IDs, credit cards, IBANs, license plates, postal codes, etc. covering 75+ countries. These work regardless of language.
- English NER — Detects person names, locations, and organizations in the extracted text.
- 390+ entity types are available when analyzing images.
What Works Well#
- Printed text in documents and forms
- Clear screenshots of text
- Scanned documents at 150+ DPI
- Typed text in photos
- Multi-word entities (automatic box merging)
What May Not Work Well#
- Handwritten text (OCR accuracy is low)
- Very small text (below ~8px font size)
- Heavily stylized or decorative fonts
- Text on complex backgrounds
- Low-contrast text
- Curved or rotated text within the image (vs. entire image rotation, which is handled via EXIF)
Redaction Options#
Fill Colors#
| Color | RGB Value | Best For |
|---|---|---|
| Black | (0,0,0) | Default, high contrast |
| White | (255,255,255) | Light documents |
| Red | (255,0,0) | Highlighting redactions |
| Green | (0,255,0) | Categorized redaction |
| Blue | (0,0,255) | Categorized redaction |
| Gray | (128,128,128) | Subtle redaction |
Modes#
| Mode | Description |
|---|---|
| Analyze | Detect PII and return entity locations (bounding boxes) without modifying the image. Useful for review before redaction. |
| Redact | Detect PII and return a new image with redaction rectangles drawn over detected entities. |
Web App Usage#
Image Tab#
- Navigate to Anonymize → Image tab
- Select a detection preset (determines which entity types to detect and OCR language)
- Upload an image by dragging/dropping or clicking to browse
- Click Analyze to preview detections, or Anonymize to redact directly
- Review the results — bounding boxes show detected entities on the original image
- Download the redacted image
Supported Presets#
All 157+ presets work with image anonymization. The preset's language setting is used as an OCR language hint for better text extraction accuracy.
Desktop App Usage#
Requirements#
Image anonymization in the desktop app requires:
- An active subscription plan that includes the Image Mode feature (Basic, Pro, or Business plans)
- Internet connection (processing happens server-side)
Usage#
- Open cloak.business desktop app
- Switch to Anonymize mode
- Click the Image tab
- Select a detection preset in the Detection Preset card
- Drop an image or click to browse (supported: PNG, JPG, BMP, TIFF)
- Click Analyze to view detections or Anonymize to redact
- View results with bounding box overlay on the original image
- Download the redacted image
Image Transforms (Desktop Only)#
Before uploading, the desktop app offers client-side transforms:
- Rotate CW — 90° clockwise rotation
- Rotate CCW — 90° counter-clockwise rotation
- Mirror — Horizontal flip
These transforms are applied before sending the image to the server.
API Reference#
Analyze Image#
Detect PII entities in an image and return their locations.
POST /api/presidio/image
Content-Type: multipart/form-data
Parameters:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file | File | Yes | — | Image file (PNG, JPG, BMP, TIFF) |
mode | string | Yes | — | Must be "analyze" |
language | string | No | "en" | ISO 639-1 code for OCR hint |
entities | string | No | all | JSON array of entity types, e.g. '["PERSON","EMAIL_ADDRESS"]' |
score_threshold | number | No | 0.5 | Minimum confidence score (0.0–1.0) |
Response (JSON):
{
"entities": [
{
"entity_type": "PERSON",
"start": 0,
"end": 9,
"score": 0.95,
"left": 100,
"top": 50,
"width": 120,
"height": 30
}
],
"processing_time": 2.345
}
Redact Image#
Detect and redact PII from an image, returning the redacted image.
POST /api/presidio/image
Content-Type: multipart/form-data
Parameters:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file | File | Yes | — | Image file |
mode | string | Yes | — | Must be "redact" |
language | string | No | "en" | ISO 639-1 code |
entities | string | No | all | JSON array of entity types |
score_threshold | number | No | 0.5 | Minimum confidence |
fill_color | string | No | "black" | Redaction color |
Response: Binary image (same format as input).
API Key Authentication (MCP / Programmatic)#
For programmatic access without browser sessions, use the JSON-based API endpoint with an API key. This is the same endpoint used by MCP clients (Claude Desktop, Cursor) and is ideal for scripts, CI/CD pipelines, and backend integrations.
Endpoint#
POST /api/mcp/image
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Parameters#
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
image | string | Yes | — | Base64-encoded image data (no data: prefix) |
image_format | string | Yes | — | "png", "jpeg", "bmp", or "tiff" |
mode | string | No | "analyze" | "analyze" or "redact" |
language | string | No | "en" | ISO 639-1 code for OCR hint |
entities | string[] | No | all | Array of entity types to detect |
score_threshold | number | No | 0.5 | Minimum confidence (0.0–1.0) |
fill_color | string | No | "black" | Redaction color (redact mode only): "black", "white", "red", "green", "blue", "gray" |
Analyze Example#
Request:
curl -X POST https://cloak.business/api/mcp/image \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "'$(base64 -w0 document.png)'",
"image_format": "png",
"mode": "analyze",
"language": "en"
}'
Response:
{
"success": true,
"entities": [
{
"entity_type": "PERSON",
"score": 0.85,
"left": 24,
"top": 31,
"width": 159,
"height": 35
},
{
"entity_type": "EMAIL_ADDRESS",
"score": 1.0,
"left": 25,
"top": 81,
"width": 284,
"height": 35
}
],
"metadata": {
"processing_time_ms": 2345,
"tokens_used": 12,
"entities_found": 2
}
}
Redact Example#
Request:
curl -X POST https://cloak.business/api/mcp/image \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "'$(base64 -w0 document.png)'",
"image_format": "png",
"mode": "redact",
"fill_color": "black",
"language": "en"
}'
Response:
{
"success": true,
"redacted_image": "<base64-encoded-png>",
"redacted_image_format": "png",
"metadata": {
"processing_time_ms": 2780,
"tokens_used": 12,
"image_size_bytes": 45200
}
}
To save the redacted image from the response:
echo "$RESPONSE" | jq -r '.redacted_image' | base64 -d > redacted.png
Differences from Session-Auth API#
| Feature | /api/presidio/image | /api/mcp/image |
|---|---|---|
| Auth | Session cookie (JWT) | API key (Bearer) |
| Content-Type | multipart/form-data | application/json |
| Image format | Binary file upload | Base64-encoded string |
| Response (redact) | Binary image | Base64 JSON |
| Use case | Web app, desktop app | MCP clients, scripts, APIs |
Getting an API Key#
- Sign in at cloak.business
- Go to Dashboard > API Keys
- Create a new API key
- Use in the
Authorization: Bearer <key>header
Token Cost#
Image processing consumes tokens from your account balance. The cost is calculated based on:
| Factor | Description |
|---|---|
| Base cost | Fixed overhead for OCR engine startup |
| File size | Cost scales with image size (per KB) |
| Entities enabled | More entity types scanned = slightly higher cost |
| Entities found | More detections = slightly higher cost |
Approximate Costs#
| Image Size | Approximate Token Cost |
|---|---|
| 500 KB | ~12 tokens |
| 1 MB | ~19 tokens |
| 2 MB | ~34 tokens |
| 5 MB | ~81 tokens |
| 10 MB | ~158 tokens |
Actual costs may vary. Costs are configurable by the platform administrator.
Plan Availability#
| Feature | Free | Basic | Pro | Business |
|---|---|---|---|---|
| Web image anonymization | — | Yes | Yes | Yes |
| Desktop image mode | — | Yes | Yes | Yes |
| Max file size | — | Plan limit | Plan limit | Plan limit |
| Daily upload limit | — | Plan limit | Plan limit | Plan limit |
Known Limitations#
OCR Accuracy#
-
Handwritten text — Tesseract OCR is designed for printed/typed text. Handwritten text recognition is poor and unreliable.
-
Monitor/screen photos — Photos taken of a computer monitor or screen may have:
- Moiré patterns from the screen pixel grid, which degrade OCR accuracy
- Glare and reflections that obscure text
- Perspective distortion from angled capture
- Low effective resolution compared to direct screenshots
Recommendation: Use a direct screenshot (PrtScn / Snipping Tool / Cmd+Shift+4) instead of photographing the screen. Screenshots are pixel-perfect and produce far better OCR results.
-
Low-resolution images — Images below 150 DPI may have degraded OCR accuracy. For scanned documents, use 200–300 DPI.
-
Complex backgrounds — Text overlaid on photos, gradients, or busy backgrounds may not be extracted reliably.
-
Small text — Text smaller than approximately 8px in the image may not be recognized.
-
Decorative/stylized fonts — Unusual fonts, heavy effects, or artistic text may not be recognized by the OCR engine.
Language Limitations#
-
Entity names (NER) — Person names, locations, and organizations are recognized using an English NER model only. Names in non-Latin scripts (Arabic, Chinese, Japanese, Korean, etc.) may be missed by the NER component. However, pattern-based recognizers (phone numbers, IDs, credit cards, postal codes) work across all languages.
-
12 languages without OCR packs — Slovak, Serbian, Latvian, Estonian, Malay, Bengali, Urdu, Swahili, Tagalog, Icelandic, Armenian, and Basque fall back to English OCR, which may reduce text extraction accuracy for those languages.
Image Format Limitations#
-
Multi-page TIFF — Only the first page is processed.
-
Animated GIF — Not supported.
-
Vector formats — SVG is not supported (rasterize first).
-
HEIC/HEIF — Apple's format is not supported. Convert to JPEG or PNG first.
-
PDF — Not supported for image anonymization. Use the text anonymization pipeline for PDF documents.
Processing Limitations#
-
150 megapixel limit — Images exceeding 150 million pixels are rejected with HTTP 413 to prevent memory exhaustion. This covers up to A0 paper at 300 DPI (140 megapixels).
-
10 MB file size ceiling — Regardless of your plan's limit, images above 10 MB are not accepted for OCR processing.
-
Automatic downscaling — Images with either dimension exceeding 4096 pixels are downscaled before OCR. This is transparent to the user — bounding box coordinates are mapped back to original dimensions. Downscaling improves speed (e.g., 11s → 3.7s for a 10327x4589 image) without meaningfully affecting OCR accuracy.
-
Processing timeout — Large or complex images may time out after 120–180 seconds.
-
No selective redaction — The current pipeline does not support redacting some entities while keeping others visible in a single pass. Use the Analyze mode first to review, then Redact.
Bounding Box Accuracy#
-
Curved text — Text that curves or follows a non-horizontal path may have inaccurate bounding boxes.
-
Overlapping text — Densely packed or overlapping text regions may produce merged or misaligned bounding boxes.
-
Rotated text within image — Text rotated within the image (e.g., watermarks at 45°) is not reliably detected. Note: entire image rotation via EXIF metadata IS handled correctly.
FAQ#
General#
Q: What types of PII can be detected in images? A: All 390+ entity types supported by cloak.business, including names, email addresses, phone numbers, credit cards, national IDs, tax IDs, passport numbers, license plates, postal codes, API keys, and more across 75+ countries. See the Entity & Preset Inventory for the complete list.
Q: Does image anonymization work offline? A: No. Image processing requires an internet connection as OCR and PII detection happen server-side.
Q: Is the original image modified? A: No. The original image is never modified. A new image with redactions is created and returned.
Q: What happens to my uploaded images? A: Images are processed in memory on the server and are not stored after processing is complete. No images are retained on disk.
Quality#
Q: I photographed my monitor but the OCR results are poor. Why? A: Photographing a screen introduces moiré patterns, glare, and perspective distortion that significantly degrade OCR accuracy. Always use a direct screenshot (PrtScn key, Snipping Tool on Windows, Cmd+Shift+4 on Mac) instead of photographing the screen. Screenshots are pixel-perfect and produce dramatically better results.
Q: My phone photo is being analyzed with the wrong orientation. Why? A: This was fixed in v5.2.0. The service now automatically reads EXIF orientation metadata and corrects the image before OCR. If you still see issues, the photo may have been stripped of EXIF data by a messaging app or editor before upload.
Q: How can I improve OCR accuracy? A: For best results:
- Use screenshots instead of photos of screens
- Scan documents at 200–300 DPI
- Ensure good lighting and focus for photos of documents
- Select the correct language in your detection preset
- Avoid uploading images with heavy compression artifacts (use PNG for screenshots)
Q: Can the service detect handwritten text? A: Tesseract OCR has limited support for handwriting. Results for handwritten text are unreliable and not recommended for production use.
Q: Why are some entity names missed in non-English images? A: The platform uses a single English NER (Named Entity Recognition) model for person names, locations, and organizations due to memory constraints. Pattern-based entities (phone numbers, IDs, credit cards, etc.) work across all languages. This is a known trade-off to keep the service responsive within server memory limits.
Format & Size#
Q: Can I anonymize PDF documents as images? A: No. PDFs should be anonymized using the text anonymization pipeline (File Drop or Batch Mode), which extracts text natively without OCR. This produces better results for PDFs.
Q: What is the maximum image size? A: 10 MB file size (absolute maximum) and 150 megapixels resolution. Images larger than 4096 pixels on the longest side are automatically downscaled before OCR for faster processing, with bounding boxes mapped back to original coordinates. Your subscription plan may have a lower file size limit.
Q: What happens if my image exceeds the pixel limit? A: Images exceeding 150 megapixels are rejected with an HTTP 413 error ("Image too large"). This limit covers up to A0 paper at 300 DPI. For most use cases (documents, photos, screenshots), the limit is never reached. Images above 4096px are automatically downscaled — no action needed from you.
Q: What image formats are supported? A: PNG, JPEG (.jpg/.jpeg), BMP, and TIFF. PNG is recommended for screenshots; JPEG for photos.
Q: Can I process multi-page TIFF files? A: Only the first page is processed. Split multi-page TIFFs into individual files.
Q: Why is HEIC not supported? A: HEIC/HEIF is Apple's proprietary format. Convert to JPEG or PNG before uploading. Most image editors and online converters can do this.
Cost & Plans#
Q: How many tokens does image processing cost? A: Cost depends on image file size and number of entities detected. A typical 2 MB image costs approximately 34 tokens. See the Token Cost section for the full table.
Q: Is image mode available on the Free plan? A: Image anonymization requires a paid plan (Basic, Pro, or Business).
Q: Are there daily upload limits? A: Yes. Upload limits (daily file count, monthly file count, and file size) are determined by your subscription plan.
Desktop App#
Q: Why is the Image tab disabled in my desktop app? A: The Image tab requires a subscription plan that includes the Image Mode feature. Upgrade to Basic, Pro, or Business to enable it.
Q: Can I rotate or flip an image before analysis? A: Yes. The desktop app provides Rotate CW, Rotate CCW, and Mirror transform buttons that process the image client-side before upload.
Q: Why does the desktop app show different results than the web app? A: Both use the same backend service. Results should be identical for the same image and preset configuration. Differences may occur if different presets or thresholds are selected.
Troubleshooting#
Common Errors#
| Error | Cause | Solution |
|---|---|---|
| "Unsupported image format" | File type not PNG/JPG/BMP/TIFF | Convert to a supported format |
| "File too large" | Exceeds 10 MB or plan limit | Reduce image size or resolution |
| "Image too large" (HTTP 413) | Exceeds 150 megapixel limit | Reduce resolution (e.g., resave at lower DPI) |
| "Image processing timed out" | Image too large/complex | Use a smaller image or lower resolution |
| "Insufficient tokens" | Not enough token balance | Top up your account |
| "Image mode not available" | Plan doesn't include image mode | Upgrade to Basic, Pro, or Business |
| "Rate limit exceeded" | Too many requests | Wait and retry (limit: 30 requests/minute) |
| "Upload limit reached" | Daily/monthly file count exceeded | Wait for limit reset or upgrade plan |
| No text detected | Poor image quality or unsupported content | See OCR Accuracy tips |
| Wrong bounding box positions | Image was rotated/cropped by editor | Re-upload original, unmodified image |
Getting Best Results#
- Use direct screenshots for screen content — never photograph a monitor
- Scan at 200–300 DPI for paper documents
- Select the correct preset language for your document's language
- Use PNG format for screenshots (lossless, no compression artifacts)
- Use JPEG format for photos (smaller file size for camera images)
- Ensure good lighting when photographing documents
- Keep images under 5 MB for fastest processing
Version History#
| Version | Date | Key Changes |
|---|---|---|
| v5.3.0 | 2026-02-12 | Auto-downscaling for large images (4096px threshold), 150MP pixel limit (was 25MP), HTTP 413 for oversized images, 3x faster OCR on high-res scans |
| v5.2.0 | 2026-02-07 | OCR language hints (37 languages), EXIF orientation fix, bbox padding/merging, custom redaction pipeline |
| v5.1.0 | 2026-02-06 | Multi-language OCR, memory optimization, single English NLP engine |
| v5.0.0 | 2026-02-05 | Initial image anonymization release |
Platform Integration History#
| Version | Date | Key Changes |
|---|---|---|
| v6.8.1 | 2026-02-12 | Hash_type validation (400 for invalid), analyzer memory optimization (MAX_CACHED_LANGUAGES 5→3), MD5 removed from API contracts |
| v6.8.0 | 2026-02-11 | Backend request limits, health check hardening, WatchdogSec disabled (incompatible with uvicorn) |
| v6.7.0 | 2026-02-10 | 317 recognizers — US & global entities, healthcare codes, financial instruments |
| v6.6.0 | 2026-02-10 | 279 recognizers — technical secrets & infrastructure recognizers |
| v6.4.3 | 2026-02-09 | 210 recognizers (246 patterns), 75+ countries, boundary assertion migration |
| v6.4.1 | 2026-02-08 | Entities JSON validation, desktop redaction fix |
| v6.4.0 | 2026-02-08 | Desktop image mode feature, plan-based limits, token cost rebalancing |
| v6.3.3 | 2026-02-07 | Bounding box overlay accuracy fix, UI label corrections |
Document maintained by cloak.business Contact: support@cloak.business