hello
I need to create in javascript something to change a color to transparent, on PNG
I'd like to create a form that, when I post a picture, everything white should be transformed to transparent and generated as a new PNG, however this white is coming from a picture so it won't be exactly white
but contrast are good since this will pictures of text written on a white page
maybe some king of green screen algo
any ideas on how to do that ?
If this is to be part of a user-submitted form, maybe set a sane default, but let the user decide exactly where to set the limit -- because it will change depending on the particular image being worked on. Some need a high tolerance because the white background isn't very close to true white, others need a low tolerance because the foreground you want to keep has highlights that are too close to white. So you give the form an extra control slider to change the tolerance between, say, 1 and 30, with it defaulting to, say, 5.