cloak.business — Image Anonymization

Last Updated: 2026-02-12 Image Redactor Version: 5.3.0 Platform Version: 6.9.1


Table of Contents#

  1. Overview
  2. Supported Image Formats
  3. How It Works
  4. OCR Language Support
  5. Detection Capabilities
  6. Redaction Options
  7. Web App Usage
  8. Desktop App Usage
  9. API Reference
  10. API Key Authentication (MCP / Programmatic)
  11. Token Cost
  12. Plan Availability
  13. Known Limitations
  14. FAQ
  15. 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#

FormatExtensionsNotes
PNG.pngRecommended for screenshots and digital documents
JPEG.jpg, .jpegPhotos, scanned documents
BMP.bmpUncompressed bitmap
TIFF.tiff, .tifMulti-page not supported (first page only)

Size Limits#

LimitValueConfigurable
Maximum file size10 MB (absolute ceiling)Plan-based (may be lower)
Maximum resolution150 megapixelsMAX_IMAGE_PIXELS env var
OCR downscale threshold4096 px (longest side)MAX_IMAGE_DIMENSION env var
Bounding box padding4 pxBBOX_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 SizeDownscaled ToOCR TimeMemory
1341 x 596 (< 4096)No downscaling~0.8sLow
5972 x 26534096 x 1819~4.1sLow
10327 x 45894096 x 1820~3.7sLow
> 150 megapixelsRejected (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)#

LanguageCodeTesseract Pack
Afrikaansafafr
Arabicarara
Bulgarianbgbul
Catalancacat
Czechcsces
Danishdadan
Germandedeu
Greekelell
Englisheneng
Spanishesspa
Persianfafas
Finnishfifin
Frenchfrfra
Hebrewheheb
Hindihihin
Croatianhrhrv
Hungarianhuhun
Indonesianidind
Italianitita
Japanesejajpn
Koreankokor
Lithuanianltlit
Macedonianmkmkd
Dutchnlnld
Norwegiannbnor
Polishplpol
Portugueseptpor
Romanianroron
Russianrurus
Slovenianslslv
Swedishsvswe
Thaiththa
Turkishtrtur
Ukrainianukukr
Vietnamesevivie
Chinese (Simplified)zhchi_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#

ColorRGB ValueBest 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#

ModeDescription
AnalyzeDetect PII and return entity locations (bounding boxes) without modifying the image. Useful for review before redaction.
RedactDetect PII and return a new image with redaction rectangles drawn over detected entities.

Web App Usage#

Image Tab#

  1. Navigate to AnonymizeImage tab
  2. Select a detection preset (determines which entity types to detect and OCR language)
  3. Upload an image by dragging/dropping or clicking to browse
  4. Click Analyze to preview detections, or Anonymize to redact directly
  5. Review the results — bounding boxes show detected entities on the original image
  6. 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#

  1. Open cloak.business desktop app
  2. Switch to Anonymize mode
  3. Click the Image tab
  4. Select a detection preset in the Detection Preset card
  5. Drop an image or click to browse (supported: PNG, JPG, BMP, TIFF)
  6. Click Analyze to view detections or Anonymize to redact
  7. View results with bounding box overlay on the original image
  8. 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:

FieldTypeRequiredDefaultDescription
fileFileYesImage file (PNG, JPG, BMP, TIFF)
modestringYesMust be "analyze"
languagestringNo"en"ISO 639-1 code for OCR hint
entitiesstringNoallJSON array of entity types, e.g. '["PERSON","EMAIL_ADDRESS"]'
score_thresholdnumberNo0.5Minimum 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:

FieldTypeRequiredDefaultDescription
fileFileYesImage file
modestringYesMust be "redact"
languagestringNo"en"ISO 639-1 code
entitiesstringNoallJSON array of entity types
score_thresholdnumberNo0.5Minimum confidence
fill_colorstringNo"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#

FieldTypeRequiredDefaultDescription
imagestringYesBase64-encoded image data (no data: prefix)
image_formatstringYes"png", "jpeg", "bmp", or "tiff"
modestringNo"analyze""analyze" or "redact"
languagestringNo"en"ISO 639-1 code for OCR hint
entitiesstring[]NoallArray of entity types to detect
score_thresholdnumberNo0.5Minimum confidence (0.0–1.0)
fill_colorstringNo"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
AuthSession cookie (JWT)API key (Bearer)
Content-Typemultipart/form-dataapplication/json
Image formatBinary file uploadBase64-encoded string
Response (redact)Binary imageBase64 JSON
Use caseWeb app, desktop appMCP clients, scripts, APIs

Getting an API Key#

  1. Sign in at cloak.business
  2. Go to Dashboard > API Keys
  3. Create a new API key
  4. Use in the Authorization: Bearer <key> header

Token Cost#

Image processing consumes tokens from your account balance. The cost is calculated based on:

FactorDescription
Base costFixed overhead for OCR engine startup
File sizeCost scales with image size (per KB)
Entities enabledMore entity types scanned = slightly higher cost
Entities foundMore detections = slightly higher cost

Approximate Costs#

Image SizeApproximate 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#

FeatureFreeBasicProBusiness
Web image anonymizationYesYesYes
Desktop image modeYesYesYes
Max file sizePlan limitPlan limitPlan limit
Daily upload limitPlan limitPlan limitPlan limit

Known Limitations#

OCR Accuracy#

  1. Handwritten text — Tesseract OCR is designed for printed/typed text. Handwritten text recognition is poor and unreliable.

  2. 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.

  3. Low-resolution images — Images below 150 DPI may have degraded OCR accuracy. For scanned documents, use 200–300 DPI.

  4. Complex backgrounds — Text overlaid on photos, gradients, or busy backgrounds may not be extracted reliably.

  5. Small text — Text smaller than approximately 8px in the image may not be recognized.

  6. Decorative/stylized fonts — Unusual fonts, heavy effects, or artistic text may not be recognized by the OCR engine.

Language Limitations#

  1. 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.

  2. 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#

  1. Multi-page TIFF — Only the first page is processed.

  2. Animated GIF — Not supported.

  3. Vector formats — SVG is not supported (rasterize first).

  4. HEIC/HEIF — Apple's format is not supported. Convert to JPEG or PNG first.

  5. PDF — Not supported for image anonymization. Use the text anonymization pipeline for PDF documents.

Processing Limitations#

  1. 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).

  2. 10 MB file size ceiling — Regardless of your plan's limit, images above 10 MB are not accepted for OCR processing.

  3. 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.

  4. Processing timeout — Large or complex images may time out after 120–180 seconds.

  5. 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#

  1. Curved text — Text that curves or follows a non-horizontal path may have inaccurate bounding boxes.

  2. Overlapping text — Densely packed or overlapping text regions may produce merged or misaligned bounding boxes.

  3. 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#

ErrorCauseSolution
"Unsupported image format"File type not PNG/JPG/BMP/TIFFConvert to a supported format
"File too large"Exceeds 10 MB or plan limitReduce image size or resolution
"Image too large" (HTTP 413)Exceeds 150 megapixel limitReduce resolution (e.g., resave at lower DPI)
"Image processing timed out"Image too large/complexUse a smaller image or lower resolution
"Insufficient tokens"Not enough token balanceTop up your account
"Image mode not available"Plan doesn't include image modeUpgrade to Basic, Pro, or Business
"Rate limit exceeded"Too many requestsWait and retry (limit: 30 requests/minute)
"Upload limit reached"Daily/monthly file count exceededWait for limit reset or upgrade plan
No text detectedPoor image quality or unsupported contentSee OCR Accuracy tips
Wrong bounding box positionsImage was rotated/cropped by editorRe-upload original, unmodified image

Getting Best Results#

  1. Use direct screenshots for screen content — never photograph a monitor
  2. Scan at 200–300 DPI for paper documents
  3. Select the correct preset language for your document's language
  4. Use PNG format for screenshots (lossless, no compression artifacts)
  5. Use JPEG format for photos (smaller file size for camera images)
  6. Ensure good lighting when photographing documents
  7. Keep images under 5 MB for fastest processing

Version History#

VersionDateKey Changes
v5.3.02026-02-12Auto-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.02026-02-07OCR language hints (37 languages), EXIF orientation fix, bbox padding/merging, custom redaction pipeline
v5.1.02026-02-06Multi-language OCR, memory optimization, single English NLP engine
v5.0.02026-02-05Initial image anonymization release

Platform Integration History#

VersionDateKey Changes
v6.8.12026-02-12Hash_type validation (400 for invalid), analyzer memory optimization (MAX_CACHED_LANGUAGES 5→3), MD5 removed from API contracts
v6.8.02026-02-11Backend request limits, health check hardening, WatchdogSec disabled (incompatible with uvicorn)
v6.7.02026-02-10317 recognizers — US & global entities, healthcare codes, financial instruments
v6.6.02026-02-10279 recognizers — technical secrets & infrastructure recognizers
v6.4.32026-02-09210 recognizers (246 patterns), 75+ countries, boundary assertion migration
v6.4.12026-02-08Entities JSON validation, desktop redaction fix
v6.4.02026-02-08Desktop image mode feature, plan-based limits, token cost rebalancing
v6.3.32026-02-07Bounding box overlay accuracy fix, UI label corrections

Document maintained by cloak.business Contact: support@cloak.business