Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created March 2, 2019 19:33
Create image data
window.plasmaRender = (w, h, ctx, buffer64) => {
let bytes = atob(buffer64);
let buffer = new Uint8ClampedArray(bytes.length);
for (let i = 0; i < bytes.length; i+=1) {
buffer[i] = bytes.charCodeAt(i);
}
let imageData = new ImageData(buffer, w, h);
ctx.putImageData(imageData, 0, 0);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment