I wanted to generate a random image. I made the following snippet, it returns a random image in the form of imageData :
const imageData = new ImageData(200, 200);
imageData.data.set(imageData.data.map(() => Math.random()*255))
console.log(imageData)
Unfortunately I need the image in the form of a base64 string. Does anyone know how to make a random base64 image or how to convert my image in base64 string? Thanks in advance.