Categories

Image Threshold

Apply threshold operation to convert images to black and white based on pixel intensity

Click to upload file or drag and drop file here

Maximum file size: 10MB Supported formats: image/jpeg, image/png, image/webp, image/gif, image/bmp, image/tiff

Pixels with value >= threshold become white (255), others become black (0)

If checked, the image will be converted to greyscale before applying threshold

Key Facts

Category
Design
Input Types
file, number, checkbox
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The Image Threshold tool allows you to convert any image into a high-contrast black and white binary format by setting a specific pixel intensity threshold. By defining a value between 0 and 255, you can isolate shapes, simplify complex visuals, or prepare images for OCR and stencil creation.

When to Use

  • Preparing images for optical character recognition (OCR) by removing background noise.
  • Creating high-contrast stencils or silhouettes from photographs.
  • Simplifying complex diagrams or sketches into binary data for technical analysis.

How It Works

  • Upload your image file in formats like PNG, JPEG, or WebP.
  • Choose whether to convert the image to greyscale first for more accurate intensity calculation.
  • Set a threshold value between 0 and 255 to determine the cutoff point for black and white pixels.
  • Process the image to generate your new binary output file.

Use Cases

Isolating text from scanned documents to improve readability.
Generating binary masks for computer vision training datasets.
Converting detailed line art into clean, black-and-white vector-ready graphics.

Examples

1. Document Text Extraction

Researcher
Background
A researcher has several scanned pages of historical documents with grey, uneven backgrounds that interfere with text recognition software.
Problem
The background noise makes the text difficult for OCR tools to parse accurately.
How to Use
Upload the document scan, enable 'Convert to Greyscale', and set the threshold to 150 to drop the background noise.
Example Config
threshold: 150, greyscale: true
Outcome
The document is converted to a clean black-and-white image, making the text stand out clearly for OCR processing.

2. Creating a Stencil

Graphic Designer
Background
A designer needs to create a simple stencil from a portrait photo for a screen printing project.
Problem
The original photo has too much detail and color variation to be used as a stencil directly.
How to Use
Upload the portrait, enable greyscale, and adjust the threshold until the facial features are clearly defined in black and white.
Example Config
threshold: 120, greyscale: true
Outcome
A high-contrast binary image that serves as a perfect template for cutting a physical stencil.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What does the threshold value represent?

It is the intensity cutoff point. Pixels with a value equal to or greater than your threshold become white (255), while those below become black (0).

Should I use the 'Convert to Greyscale' option?

Yes, enabling this is recommended for color images to ensure the threshold is applied consistently across all color channels.

What file formats are supported?

You can upload JPEG, PNG, WebP, GIF, BMP, and TIFF files.

Is there a file size limit?

Yes, the maximum file size for uploads is 10 MB.

Can I process multiple images at once?

No, this tool is designed to process one image file at a time.

API Documentation

Request Endpoint

POST /en/api/tools/image-threshold

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes -
threshold number Yes Pixels with value >= threshold become white (255), others become black (0)
greyscale checkbox No If checked, the image will be converted to greyscale before applying threshold

File type parameters need to be uploaded first via POST /upload/image-threshold to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-image-threshold": {
      "name": "image-threshold",
      "description": "Apply threshold operation to convert images to black and white based on pixel intensity",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-threshold",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]