joedf / ImgBeamer

SEM image formation process demo tool
https://joedf.github.io/ImgBeamer
MIT License
2 stars 0 forks source link

Canvas RGBA pixel values are inaccurate (alpha premultiplication?) #25

Open joedf opened 1 year ago

joedf commented 1 year ago

Look into canvas alpha premultiplication issues? https://stackoverflow.com/a/42294622/883015

Causes thing like black pixels (0x000000) be read as (0x010101), or (0x808080) as (0x767676)... Noticed from unit testing the image metrics (js-tests)... Output values were off because of this?

joedf commented 1 year ago

https://html.spec.whatwg.org/multipage/canvas.html#premultiplied-alpha-and-the-2d-rendering-context