https://github.com/yuaanlin/haar-wavelet-image-compression-visualization
A backend service written in Go (Gin) that shows the visualization of image compression with Haar Wavelet.
https://github.com/yuaanlin/haar-wavelet-image-compression-visualization
gin gin-gonic go golang haar-wavelet-tranforms haar-wavelets image-compression image-processing multimedia zhejiang-university zju
Last synced: 2 months ago
JSON representation
A backend service written in Go (Gin) that shows the visualization of image compression with Haar Wavelet.
- Host: GitHub
- URL: https://github.com/yuaanlin/haar-wavelet-image-compression-visualization
- Owner: yuaanlin
- Created: 2022-04-02T02:57:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-09T07:33:59.000Z (about 3 years ago)
- Last Synced: 2025-02-03T08:48:20.089Z (4 months ago)
- Topics: gin, gin-gonic, go, golang, haar-wavelet-tranforms, haar-wavelets, image-compression, image-processing, multimedia, zhejiang-university, zju
- Language: Go
- Homepage: https://haar.linyuanlin.com
- Size: 359 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Haar Wavelet Image Compression Visualization
This is a backend service written in [Go](https://go.dev/) ([Gin](https://github.com/gin-gonic/gin)) that shows the visualization of [image compression with Haar Wavelet](https://medium.com/@digitalpadm/image-compression-haar-wavelet-transform-5d7be3408aa).
## How to use
Visit https://haar.linyuanlin.com to see the visualization.
## How to use (as API service)
Assume you have an image file with name `origin.bmp` (currently only `.bmp` is supported) and you want to compress it.

Post the image to the `/upload` endpoint with form field name `image`:
```bash
curl -F "[email protected]" https://api.haar.linyuanlin.com/upload# > {"id":"e9b6a509"}
```You will get the id of the image (`e9b6a509` in this example).
Then, you can use this id to get each step of the haar wavelet compression:
```bash
curl "https://api.haar.linyuanlin.com/visualization?uid=e9b6a509" --output result.jpg
```The `result.jpg` is identical to the original image, because you don't specify the `step` option. Which means this is `step=0` (original image).

If you want to see the compression result at step `1`, you can use the following command:
```bash
curl "https://api.haar.linyuanlin.com/visualization?uid=e9b6a509&step=1" --output result.jpg
```You can see the result after first step of haar wavelet transform.
