Dumb-Code / DumbCode-Studio

The complete suite of DumbCode made tools for modeling, animating and managing minecraft style game assets
https://studio.dumbcode.net/
1 stars 1 forks source link

Handle textures with webgl canvas, instead of canvas2d #228

Closed Wyn-Price closed 2 years ago

Wyn-Price commented 2 years ago

Canvas 2d uses premultiplied alpha, and therefore makes it impossible to have the image stored on the canvas in a lossless way.

Note that we have to read from a framebuffer, as canvas.toDataUrl always premultiplies the image, no matter the configuration or options