How to adaptively adjust the contrast of an image in Node.JS

npm install cloudmersive-image-api-client --save
var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveImageApiClient.EditApi();var gamma = 1.2; // Number | 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.var imageFile = "/path/to/file"; // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.var callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.editContrastAdaptive(gamma, imageFile, callback);

--

--

--

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

NodeJS Graphql Server with Apollo

Accounts in SORA

[Learning]#29 JS: AJAX

Functional vs. Object-Oriented Programming in JavaScript

Using IPFS with Caver

How we built a faster Toppr web app using React and Redux

React Intermediate Concepts You Must Know

React Intermediate concepts

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
Cloudmersive

Cloudmersive

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

More from Medium

How to Convert an Audio File to MP3 Format using JavaScript

How to get date with different timezone on bash scripts

How to write your first function in C — main(); printf();

Using Android Debug Bridge (ADB) with Python to automate TikTok.