YahooArchive/pngjs-image

Should be a way to get base64 image

Daxito opened this issue · 3 comments

Should be a way to get image as base64.

You can do the following to get the base64 image:

var base64Image = 'data:image/png;base64,' + image.getBlob().toString('base64');

I will try that, thank you!

zyzof commented

Thanks @marcelerz.

I found that to get a base64 image that could be embedded in an HTML <img> tag, I had to use:
var base64Image = 'data:image/png;base64,' + image.toBlobSync().toString('base64');