This is a simple backend API built with Fiber, a web framework for Golang, designed to remove the background from PNG or JPG images. The API provides a single endpoint to process images and return the result with the background removed.
- Remove background from PNG and JPG images.
- Fast and efficient processing using Golang and Fiber.
- Simple and easy-to-use API.
- Go 1.16 or later
- Fiber framework
-
Clone the repository:
git clone https://github.com/yourusername/image-converter-api.git cd image-converter-api
-
Install dependencies:
go get
-
Run the server:
go run main.go
The API provides a single endpoint to remove the background from an image.
- POST
/remove-background
- Headers:
Content-Type: multipart/form-data
- Body: Form-data with a file field named
image
containing the PNG or JPG file.
- Success: Returns the image with the background removed.
- Error: Returns an error message if the processing fails.
You can use curl
to test the API:
curl -X POST http://localhost:3000/image/convert?fore_color=#FFFFFF&back_color=#000000 \
-F "file=@/path/to/your/image.png" \
-o output.png
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the Fiber team for their excellent framework.
- Inspired by various open-source image processing tools.