I need to read the transparency value for each pixel of a user submitted PNG, on the front-end.
Right now I'm blocking the form submission and I convert the PNG in the file input to a FileReader object. Now I was thinking that I could simply read the transparency values out of that data. For example, I converted to ArrayBuffer and then to Uint8Array, and that's a large array of ints whose values range from 0-255, but it doesn't look like the right colors.
Then I read that you must actually display the PNG on an HTML5 canvas in order to do this.