4 ms·
Gamma Adjustment in an HTML5 Canvas
- secoif 15y agoForgive my naivety, but why do we have cross domain limitations if I can fire up a proxy and do the exact same thing? What's the difference?
- andrewvc 15y agoThe difference is in being explicit with permissions. That said, JSONP is one of the ugliest (but useful!) hacks ever invented. For more details: http://en.wikipedia.org/wiki/Same_origin_policy http://en.wikipedia.org/wiki/Same_origin_policy
- muyyatin 15y agoYour proxy wouldn't send the user's cookies with its request.
- simonsarris 15y agoBecause you can't pull an image off of someone's computer and upload it to your server with a proxy. Without cross domain limitations on canvas, you could do that. I wrote a bit about those rules a while back: http://simonsarris.com/blog/480-understanding-the-html5-canvas-image-security-rules http://simonsarris.com/blog/480-understanding-the-html5-canv...
- kevingadd 15y agoIf you intend to gamma correct images, gamma correcting the alpha channel like this code snippet does is not desirable.