Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just out of curiosity, how did you overcome slow HTML5 canvas' getImageData and pixel reading from an image affected by CORS (tainted canvas)?


i am interested in this as well.

the app is awesome btw!


with WebGL?


WebGL textures suffer from the same problem as shaders can be used to extract data. WebGL is hence using CORS as well. Do you say the performance penalty in WebGL is non-existing contrary to canvas?


what data do you want to extract?, all postprocessing effects are made with GLSL shaders, you don't process data with javascript algorithms.


Just the call on getImageData to extract texture and read all pixels from an image can take 15s if CORS is in the play...


you don't call getImageData to extract a texture data. You load the image, make a texture of it, and then apply all postprocessing effects with a WebGL shader.


OK, thanks for the hint! I'll try to play with CORSed image texture binding to see what the performance is.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: