Berak , thx for your note, I found a great site that explains datauri conversion options with opencv.js
https://github.com/justadudewhohacks/...
// load base64 encoded image
const base64text='data:image/png;base64,R0lGO..';//Base64 encoded string
const base64data =base64text.replace('data:image/jpeg;base64','')
.replace('data:image/png;base64','');//Strip image type prefix
const buffer = Buffer.from(base64data,'base64');
const image = cv.imdecode(buffer); //Image is now represented as Mat
// convert Mat to base64 encoded jpg image
const outBase64 = cv.imencode('.jpg', croppedImage).toString('base64'); // Perform base64 encoding
const htmlImg=''; //Create insert into HTML compatible tag
can you show us, what you have, so far ? what are you trying to achieve ? what's the "context" ?
no js expert, but imho, you should load your image into a canvas, and use cv.matFromImageData from that.
(in the same way, imread() does it, just look at helper.js / utils.js)