How to adaptively adjust the contrast of an image in Python

pip install cloudmersive-image-api-client
from __future__ import print_functionimport timeimport cloudmersive_image_api_clientfrom import ApiExceptionfrom pprint import pprint# Configure API key authorization: Apikeyconfiguration = cloudmersive_image_api_client.Configuration()configuration.api_key['Apikey'] = 'YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Apikey'] = 'Bearer'# create an instance of the API classapi_instance = cloudmersive_image_api_client.EditApi(cloudmersive_image_api_client.ApiClient(configuration))gamma = 1.2 # float | Gamma value to adjust the contrast in the image.  Recommended value is 2.0.  Values between 0.0 and 1.0 will reduce contrast, while values above 1.0 will increase contrast.image_file = '/path/to/file' # file | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.try:# Adaptively adjust the contrast of the image to be more appealing and easy to seeapi_response = api_instance.edit_contrast_adaptive(gamma, image_file)pprint(api_response)except ApiException as e:print("Exception when calling EditApi->edit_contrast_adaptive: %s\n" % e)




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Jenkins & its use cases

Static Libraries vs Dynamic libraries

Scalaz for Dummies

Designing Online Game (System Design)

RPA Analytics Solution , Automation Analytics , RPA Insight, Build RPA Center Of Excellence

OAuth2 Configuration in 3Scale API Management (and APICast) with Red Hat SSO

How to use slacklogger for easy application-level logging

How to Schedule Python Scrapy Spiders on Heroku using Custom Clock Process for Free

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Generate a UPC-A code barcode as PNG file in Python

String Methods in Python

Python Arrays