Contrast
Increases or decreases the image contrast.
How to use
The contrast transformation allows you to adjust the contrast of an image.
Pass the following query param to the API endpoint:
contrast=amount
Where:
amount
is the percentage to increase or decrease the image contrast.
For example: contrast=50
or contrast=-30
Parameter
amount
: The percentage to adjust the contrast. This parameter accepts integer values from -100 to 100:
- Positive values increase contrast
- Negative values decrease contrast
- 0 leaves the contrast unchanged (default)
- -100 results in a solid gray image
- 100 produces maximum contrast
Effect of Contrast Adjustment
- Increasing contrast enhances the difference between light and dark areas in the image.
- Decreasing contrast reduces the difference between light and dark areas, making the image appear more flat.
- Extreme contrast adjustments can lead to loss of detail in very light or very dark areas.
This transformation is useful for enhancing the visual appeal of images, correcting flat-looking photos, or creating artistic effects.
Original Image
URL : https://www.thunderimage.com/sample/yosemite.jpg
Image with Increased Contrast
URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&contrast=50
Image with Decreased Contrast
URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&contrast=-50
Best Practices
- Use moderate contrast adjustments (e.g., -30 to 30) for subtle enhancements.
- Be cautious with high contrast values as they may lead to loss of detail in highlights and shadows.
- For photos, slightly increasing contrast can often make them more visually appealing.
- When decreasing contrast, be aware that the image may start to look flat or washed out.
- Consider the content of your image when adjusting contrast - high contrast works well for graphic designs, while lower contrast may be suitable for softer, more atmospheric images.
- Combine contrast adjustments with other transformations like brightness or saturation for more comprehensive image enhancements.
Note
The effect of contrast adjustment can vary depending on the original image. Images that already have high contrast may not show significant changes with further increases, while low contrast images may be more dramatically affected by adjustments.
Authorizations
API key required for authentication
Query Parameters
The URL of the image to be transformed.
The amount to adjust the contrast. Positive values increase contrast, negative values decrease it.
-100 < x < 100
Response
The transformed image in JPEG format.