'How to convert base64 color image to grayscale image using javascript

can I know how to convert base64 color image to grayscale image using javascript? I'm using the Cordova camera plugin to take pictures and need to save base64 data in the database as a grayscale image.



Solution 1:[1]

EX on Codepen

 context.filter = 'grayscale(100%)'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yeonathan Aizenberg