🔄

Contrast Adjustment

Adjust the contrast of an image

GET 10 credits /v1/image/adjust/contrast
curl "https://image.toolkitapi.io/v1/image/adjust/contrast?url=https://toolkitapi.io/static/samples/sample-image.png&factor=1.6&format=jpeg"
import httpx

resp = httpx.get(
    "https://image.toolkitapi.io/v1/image/adjust/contrast?url=https://toolkitapi.io/static/samples/sample-image.png&factor=1.6&format=jpeg",
)
print(resp.json())
const resp = await fetch("https://image.toolkitapi.io/v1/image/adjust/contrast?url=https://toolkitapi.io/static/samples/sample-image.png&factor=1.6&format=jpeg", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "image": "/9j/4AAQSkZJRgABAQ...(base64 data)...",
  "format": "jpeg",
  "factor": 1.6
}

Try It Live

Live Demo

Description

Adjust the contrast of an image

How to Use

1

1. Provide the source image via the `url` query parameter.

2

2. Set the `factor` parameter to control the adjustment intensity (1.0 = no change).

3

3. Choose your preferred output `format` (png, jpeg, or webp) and `quality` level.

About This Tool

Use the Contrast Adjustment endpoint to increase or decrease the contrast of an image. The factor controls intensity: 1.0 is unchanged, below 1.0 flattens contrast (grey wash), and above 1.0 boosts it (punchier shadows and highlights).

Contrast adjustment is essential for photo editing workflows, improving readability of scanned documents, and creating high-impact visuals. The endpoint uses PIL's ImageEnhance.Contrast for perceptually balanced results.

Why Use This Tool

Frequently Asked Questions

What does a factor of 0.0 produce?
A factor of 0.0 produces a solid grey image (all pixels become the mean luminance). A factor of 2.0 roughly doubles the contrast.
Can I use this to improve scanned documents?
Yes, increasing contrast (1.5–2.5) can significantly improve text readability in scanned or photographed documents.
How does contrast interact with brightness?
Contrast adjusts the spread between light and dark values; brightness shifts all values uniformly. For best results, adjust brightness first, then contrast.

Start using Contrast Adjustment now

Get your free API key and make your first request in under a minute.