I'm working in an Javascript application that receives a base64 array. This array encodes a 16 bits per pixel raw image.
Thus, I would like to do some calculations in it. For this, I need to unpack this Base64 string in a Uint16Array, so I can iterate over pixels and perform the required calculations.
What are my options for doing that?
You can use this function that converts a base64 string into a binary Uint16 Array
If you're targeting Firefox and feeling adventurous you can shorten the function down to this: