This is a project to teach you how image compression algorithm wokrs.
But currently it only supports the feature to convert the uploaded jpg file to a grayscale file.
Notes, in order to successfully build and run with the project, you should prepare the enviornment as instructed here.
# install dependencies
npm i
# build
npm run build
# start the server at http://localhost:8080
npm run start
According to the issue image-rs/image#879, we have to disable the "jpeg_rayon" feature in Cargo.toml.
To save converted image in server, we should use wasi + wasm https://www.secondstate.io/articles/wasi-access-system-resources/.
This project is inspired by this post and this post and this fantastic video. You can also learn more about image compression algorithm from them.