I am developing a Javascript application (runs in the browser, not a Node app or similar) and I have a requirement: in my app I have images (jpegs and pngs) in Blob form and I want to manipulate them in the following way:
- I need to resize the images to a certain max resolution
- I need to bring the images to a specific aspect ratio (without distorting them, meaning: if the image is not already at the correct aspect ratio I want to add a filler color to the left/right or top/bottom in order to bring it to the desired aspect ratio)
The library needs to be free to use (gratis).
I have found libraries that can accomplish the first step (e.g.: Pica) but I'm having trouble finding something that fulfills my second requirement.