This Go server allows you to upload multiple images and interlace them for lenticular printing. The server uses the Gorilla Mux router and the disintegration/imaging
package for image processing.
- Upload multiple images
- Interlace images based on a specified strip width
- Returns the interlaced image as a PNG
- Go (version 1.16 or higher)
- Git (to clone the repository)
-
Clone the repository:
git clone https://github.com/S1D007/Lenticular-Proto.git cd Lenticular-Proto
-
Install dependencies:
Use the following command to install the required packages:
go get -u github.com/gorilla/mux go get -u github.com/disintegration/imaging
-
Run the server:
Start the server by running:
go run main.go
The server will start on
http://localhost:8081
.
This endpoint allows you to upload images and specify the strip width for interlacing.
Request Parameters:
images
: One or more images to be interlaced (multipart form data).stripWidth
: (Optional) A float representing the width of the strips for interlacing. If not provided, defaults to8.0
.
Example Request Using curl:
curl -X POST -F "images=@path_to_image1.jpg" -F "images=@path_to_image2.jpg" -F "stripWidth=10.5" http://localhost:8081/upload
Response:
- On success: The interlaced image will be returned as a PNG.
- On error: A JSON response with an error message will be returned.
Example Error Response:
{
"error": "Unable to parse form"
}
- Gorilla Mux for routing
- disintegration/imaging for image processing