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

Most Popular Technology Stack To Choose From: Full Stack Vs. MEAN Stack Vs. MERN Stack In 2019

Building a compass web app

How to Generate Database Scripts With Data In SQL Server

OpenShift — Day 01

Local hadoop on laptop for practice

Essential VSCode Extensions For Development

Industry use cases on Openshift

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 EAN-8 code barcode as PNG file in Python

Using Django ORM as a standalone

How to access User’s clipboard in JavaScript

Designing a monthly subscription-based Python Django app with Stripe APIs — I