How to invert or negate the colors in an image using Node.JS

"dependencies": {
"cloudmersive-image-api-client": "^1.2.3"
}
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 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.editInvert(imageFile, callback);
Pretty cool!

--

--

--

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

How to fully validate a URL in Javascript

Announcing jsecrets 🤐

Testing with real files in Angular

#230: Limited to 36H — 4M Otaku Coins Giveaway! Take Equal Shares

Make API calls in React using custom hook.

You Should be Linting in 2019

Design Patterns

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

A REST API WITH KOA

Koa.js and How to create Backend with CRUD Operations

Day 2 of Game Dev: Learning how to push, pull, commit and comment using Git!

Project-DERMSTORE