How to despeckle to remove point noise from an image in Node.JS

Any time you work with large numbers of images, it is a smart choice to set up automated systems for processing said images. For example, performing a basic de-noising routine. You can certainly set this up from scratch, but who has time for that? I’m going to show you how to apply an API to the problem instead, saving you a ton of time.

We begin by installing our SDK:

npm install cloudmersive-image-api-client --save

Now call filterDespeckle from our API like this:

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';var apiInstance = new CloudmersiveImageApiClient.FilterApi();var imageFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // 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.filterDespeckle(imageFile, callback);

Done! Our despeckle function is ready to go on any image you like.

Image for post
This photo could sure use a quick pass with the despeckler.

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

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